HeaderedItemsControl Class
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace: http://schemas.microsoft.com/winfx/2006/xaml/presentation
[LocalizabilityAttribute(LocalizationCategory.Menu)] public class HeaderedItemsControl : ItemsControl
/** @attribute LocalizabilityAttribute(LocalizationCategory.Menu) */ public class HeaderedItemsControl extends ItemsControl
LocalizabilityAttribute(LocalizationCategory.Menu) public class HeaderedItemsControl extends ItemsControl
<HeaderedItemsControl> Items </HeaderedItemsControl>
Use this class to create a control that contains a heading (or title) and multiple items. A HeaderedItemsControl has a limited default style. To create a HeaderedItemsControl with a custom appearance, you can create a new control template.
Set the Header property to specify the label of the HeaderedItemsControl. Header can be a string or a UIElement. Set the HeaderTemplate property to a DataTemplate to customize the header. For more information on data templates, see Data Templating Overview.
Content Model: For information on the content model for HeaderedItemsControl, see HeaderedItemsControl Content Model.
The following example creates a HeaderedItemsControl.
<!--Define a control template for a HeaderedItemsControl--> <Style TargetType="HeaderedItemsControl"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type HeaderedItemsControl}"> <StackPanel> <Grid> <Rectangle Fill="{TemplateBinding Background}"/> <ContentPresenter ContentSource="Header"/> </Grid> <Grid> <Rectangle Stroke="{TemplateBinding BorderBrush}"/> <ItemsPresenter Margin="2,0,0,0"/> </Grid> </StackPanel> </ControlTemplate> </Setter.Value> </Setter> </Style> ... <HeaderedItemsControl xmlns:sys="clr-namespace:System;assembly=mscorlib" Header="My colors" Background="SteelBlue" BorderBrush="DarkSlateBlue"> <sys:String>Red</sys:String> <sys:String>Yellow</sys:String> <sys:String>Blue</sys:String> <sys:String>Green</sys:String> </HeaderedItemsControl>
System.Windows.Threading.DispatcherObject
System.Windows.DependencyObject
System.Windows.Media.Visual
System.Windows.UIElement
System.Windows.FrameworkElement
System.Windows.Controls.Control
System.Windows.Controls.ItemsControl
System.Windows.Controls.HeaderedItemsControl
System.Windows.Controls.MenuItem
System.Windows.Controls.ToolBar
System.Windows.Controls.TreeViewItem
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.