HeaderedContentControl Class
Updated: February 2009
Provides the base implementation for all controls that contain single content and have a header.
Assembly: PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
Content Model: The Content property and Header property of a HeaderedContentControl can be set to any type of object. For more information on the content model for HeaderedContentControl, see Controls Content Model Overview.
A HeaderedContentControl has a limited default style. An application developer can create a HeaderedContentControl, but its appearance will be very simple. If you wish to enhance the appearance of the control, you can create a new ControlTemplate. A HeaderedContentControl is useful for creating custom controls because it provides a model for single content controls with headers.
Dependency properties for this control might be set by the control’s default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. For more information, see Themes.
The following examples show how to create a ControlTemplate for a HeaderedContentControl.
<Style TargetType="HeaderedContentControl"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type HeaderedContentControl}"> <StackPanel> <Grid> <Rectangle Stroke="{TemplateBinding Background}"/> <ContentPresenter ContentSource="Header"/> </Grid> <Grid> <Rectangle Fill="{TemplateBinding Background}"/> <ContentPresenter ContentSource="Content"/> </Grid> </StackPanel> </ControlTemplate> </Setter.Value> </Setter> </Style>
<HeaderedContentControl Background="LightBlue" Header="Header" Content="This is the content"/>
System.Windows.Threading.DispatcherObject
System.Windows.DependencyObject
System.Windows.Media.Visual
System.Windows.UIElement
System.Windows.FrameworkElement
System.Windows.Controls.Control
System.Windows.Controls.ContentControl
System.Windows.Controls.HeaderedContentControl
System.Windows.Controls.Expander
System.Windows.Controls.GroupBox
System.Windows.Controls.TabItem
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Date | History | Reason |
|---|---|---|
February 2009 | Described how default styles change dependency properties. | Customer feedback. |
July 2008 | Added new members: HeaderStringFormat property, HeaderStringFormatProperty field, OnHeaderStringFormatChanged method. | SP1 feature change. |