Friday, March 8 Creating real Custom Controls Kelvin van Geene 12:15

Preview:

DESCRIPTION

How to choose best approach User Controls vs. Custom Controls agenda

Citation preview

Friday, March 8

Creating real Custom ControlsKelvin van Geene12:15

User Controls vs. Custom Controls

agenda

How to choose best approach

User Controls vs. Custom Controls

agenda

How to choose best approach

User Controls vs. Custom Controls

Demo: Creating a Win8 Custom Control

agenda

User Control

what is a user control

User Control

ButtonCombo BoxText Box

Text Box

Text Box

Text Box Grid

what is a user control

User Control

ButtonCombo BoxText Box

Text Box

Text Box

Text Box Grid

A composition of existing UIElements with some extra plumming code

what is a user control

User Control

ButtonCombo BoxText Box

Text Box

Text Box

Text Box Grid

XAML Code File

C#Code Class

+ +

A composition of existing UIElements with some extra plumming code

what is a user control

what is a Custom Control

Custom Control

what is a Custom Control

Custom Control

Existing control

An extension to an existing control created in a standalone library

what is a Custom Control

Custom Control

Existing control

Added ExtendingFunctionality

An extension to an existing control created in a standalone library

what is a Custom Control

Custom Control

Existing control

AddedExtendingFunctionality Themes

An extension to an existing control created in a standalone library

what is a Custom Control

Custom Control

Existing control

AddedExtendingFunctionality Themes

Resource Dictionary

+

An extension to an existing control created in a standalone library

what is a Custom Control

Custom Control

Existing control

AddedExtendingFunctionality Themes

Resource Dictionary

C#Code Class

+ +

An extension to an existing control created in a standalone library

supported in technologies

Windows Phone

supported in technologies

Windows Phone Silverlight

supported in technologies

Windows 8

Windows Phone Silverlight

supported in technologies

Windows 8

Windows Phone Silverlight

WPF

supported in technologies

technical implementation

User Control

Custom Control

UserControl

Control

UIElement

FrameworkElement

DependancyObject

Class Hierarchy

Base object in XAML related technologies

Base API’s like binding and object tree

Base class for objects with a visual appearance

Base class for UIElements which use a Control Template

Base class for grouping UIElements with own logic

overview summaryUser Control Custom Control

Technical challenge

overview summaryUser Control Custom Control

Technical challenge Easy to create Requires a deep understanding of theUI model

overview summaryUser Control Custom Control

Technical challenge

Type of UI

Easy to create Requires a deep understanding of theUI model

overview summaryUser Control Custom Control

Technical challenge

Type of UI

Easy to create Requires a deep understanding of theUI model

Static and Fixed UI, which cannot be changed in other projects

Dynamic and skinnable UI which can be changed in other projects

overview summaryUser Control Custom Control

Technical challenge

Type of UI

Technical implementation

Easy to create Requires a deep understanding of theUI model

Static and Fixed UI, which cannot be changed in other projects

Dynamic and skinnable UI which can be changed in other projects

overview summaryUser Control Custom Control

Technical challenge

Type of UI

Technical implementation

Easy to create Requires a deep understanding of theUI model

Static and Fixed UI, which cannot be changed in other projects

Dynamic and skinnable UI which can be changed in other projects

Representation of a set of existing controls compiled in the application DLL

Implemented at code level providing more flexibility. Compiled in its own DLL.

how to choose best approach

how to choose best approach

Time and Budget

how to choose best approach

ExtensibilityTime and Budget

how to choose best approach

UI Flexibility

ExtensibilityTime and Budget

how to choose best approach

UI Flexibility

ExtensibilityTime and Budget

Technical Difficulty

how to choose best approach

Control lacks a certain style, UI only

how to choose best approach

Control lacks a certain style, UI only

Control Template

Y

how to choose best approach

Control lacks a certain style, UI only

Control requires additional functionality which can be created with combining available controls

Control Template

N

Y

how to choose best approach

Control lacks a certain style, UI only

Controls requires additional functionality which can be created with combining available controls

Control Template

Custom Control

N

Y

N

how to choose best approach

Control lacks a certain style, UI only

Controls requires additional functionality which can be created with combining available controls

Theming or sharing with different projects is required

Control Template

Custom Control

N

Y

N

Y

how to choose best approach

Control lacks a certain style, UI only

Controls requires additional functionality which can be created with combining available controls

Theming or sharing with different projects is required

Control Template

Custom Control User Control

N

Y

N

YNY

Our scenario is to create a Sound Player control for Win8 Apps with a Skinnable UI which need to be included into the NuGet packaging framework later on

demo

in closing – not discussed

VSIX Control Parts

NuGet