Updated: February 2009
Provides the base implementation for all controls that contain single content and have a header.
<LocalizabilityAttribute(LocalizationCategory.Text)> _ Public Class HeaderedContentControl _ Inherits ContentControl
Dim instance As HeaderedContentControl
[LocalizabilityAttribute(LocalizationCategory.Text)] public class HeaderedContentControl : ContentControl
[LocalizabilityAttribute(LocalizationCategory::Text)] public ref class HeaderedContentControl : public ContentControl
public class HeaderedContentControl extends ContentControl
<HeaderedContentControl> Content </HeaderedContentControl>
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"/>
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
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.