Skip to content

Control Families in WPF

May 9, 2006
Back in fall of 2003, I blogged about Avalon’s 5 Element Families: Panels, Controls, Shapes, Decorators, & Content Elements.  Those concepts still hold true.
 
Drilling into Controls
There are a few different subclasses of Control that are worthy of digging into if you are diving into WPF development:
ContentControls – elements which have one item of type object as their content.  Based on the type of the content, different things happen:
  • string – display inside of the control (usually via a TextBlock inside of the control’s Template.
  • UIElement – display inside of the control
  • object – (usually a business object of some sort), databinding will kick in here…<Button><my:Customer FirstName="Tom" /></Button> will render the customer as you specify in the DataTemplate targetted toward all Customers.

ContentControls include Button, ListBoxItem, RadioButton, CheckBox, etc…

 

ItemsControls – elements which have 0-n items of type object as their content.  There is much more to this, but it looks like Ben is going to be going into more detail.  I’d suggest you listen in there…
 
 
 

From → WPF

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: