Control Families in WPF
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…