Redigera

Dela via


HeaderedContentControl.HeaderTemplateSelector Property

Definition

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

public:
 property System::Windows::Controls::DataTemplateSelector ^ HeaderTemplateSelector { System::Windows::Controls::DataTemplateSelector ^ get(); void set(System::Windows::Controls::DataTemplateSelector ^ value); };
[System.ComponentModel.Bindable(true)]
public System.Windows.Controls.DataTemplateSelector HeaderTemplateSelector { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.HeaderTemplateSelector : System.Windows.Controls.DataTemplateSelector with get, set
Public Property HeaderTemplateSelector As DataTemplateSelector

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

Identifier field HeaderTemplateSelectorProperty
Metadata properties set to true None

Applies to