HeaderedContentControl.HeaderTemplateSelector Property

Definition

Gets or sets a data template selector that provides custom logic for choosing the template used to display the header.

C#
[System.ComponentModel.Bindable(true)]
public System.Windows.Controls.DataTemplateSelector HeaderTemplateSelector { get; set; }

Property Value

A data template selector object. The default is null.

Attributes

Remarks

If both the HeaderTemplateSelector and the HeaderTemplate properties are set, the template selector property is ignored.

XAML Attribute Usage

<object HeaderTemplateSelector="{ResourceExtension DataTemplateSelectorClassKey}"/>

XAML Property Element Usage

<object>
  <object.HeaderTemplateSelector>
    <MyDataTemplateSelectorImplementation .../>
  </object.HeaderTemplateSelector>
</object>

XAML Values

MyDataTemplateSelectorImplementation A class derived from DataTemplateSelector that implements a practical SelectTemplate override. For information about how to map your custom class, see XAML Namespaces and Namespace Mapping for WPF XAML.

ResourceExtension One of the following: StaticResource, or DynamicResource. See XAML Resources.

DataTemplateSelectorClassKey The key that identifies the selector implementation being requested. The key refers to a derived class that implements a practical SelectTemplate override. For information about how to map your custom class, see XAML Namespaces and Namespace Mapping for WPF XAML. You can also programmatically add an instance of your DataTemplateSelector class as a resource to a resource dictionary.

Dependency Property Information

Item Value
Identifier field HeaderTemplateSelectorProperty
Metadata properties set to true None

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10