HeaderedItemsControl Styles and Templates

HeaderedItemsControl Styles and Templates


This topic describes the styles and templates for the HeaderedItemsControl control. You can modify the default ControlTemplate to give the control a unique appearance. For more information, see Customizing the Appearance of an Existing Control by Using a ControlTemplate.

The following shows the XML namespace mappings that you have to specify when you work with styles and templates.

<!-- XML Namespace mappings. -->
Important noteImportant Note:

The default templates for controls in Silverlight 4 still use the Silverlight 3-style prefixes, such as controls: and data: instead of sdk:. This is because the default control templates support Silverlight 3 and Silverlight 4 simultaneously. For more information, see Prefixes and Mappings for Silverlight Libraries.


The default templates still specify the vsm: XML namespace mapping for the VisualStateManager element for legacy reasons. You can however, use the VisualStateManager element without specifying the vsm: mapping.

The following XAML shows the default style and template for the HeaderedItemsControl control.

<Style TargetType="controls:HeaderedItemsControl">
    <Setter Property="Template">
            <ControlTemplate TargetType="controls:HeaderedItemsControl">
                <Grid x:Name="Root">
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                    <ContentControl x:Name="HeaderContent" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" />
                    <ItemsPresenter x:Name="Items" Grid.Row="1" />

Community Additions

© 2015 Microsoft