ContentPresenter.ContentTemplateSelector Property

Definition

Gets or sets the DataTemplateSelector, which allows the application writer to provide custom logic for choosing the template that is used to display the content of the control.

C#
public System.Windows.Controls.DataTemplateSelector ContentTemplateSelector { get; set; }

Property Value

A DataTemplateSelector object that supplies logic to return a DataTemplate to apply. The default is null.

Remarks

This property is ignored if the ContentTemplate property is set. For more information, see ChooseTemplate.

XAML Text Usage

For XAML information, see TemplateBinding Markup Extension.

Dependency Property Information

Item Value
Identifier field ContentTemplateSelectorProperty
Metadata properties set to true AffectsMeasure

Applies to

Produkt Versionen
.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

See also