O'Reilly logo

XAML Unleashed by Adam Nathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Data Templates

A data template is a piece of user interface that you’d like to apply to an arbitrary object when it is rendered. Many controls have properties (of type DataTemplate) for attaching a data template appropriately. For example, ContentControl and HubSection have a ContentTemplate property for controlling the rendering of its Content object, and ItemsControl has an ItemTemplate that applies to each of its items. Controls with Headers and Footers have HeaderTemplate and FooterTemplate properties to control their appearance. In addition, ComboBox has a SelectionBoxItemTemplate property, and ToggleSwitch has OnContentTemplate and OffContentTemplate properties.

By setting one of these properties to an instance of a DataTemplate

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required