This documentation is archived and is not being maintained.

ContentPresenter.ContentTemplateSelector Property

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.

Namespace: System.Windows.Controls
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:

public DataTemplateSelector ContentTemplateSelector { get; set; }
/** @property */
public DataTemplateSelector get_ContentTemplateSelector ()

/** @property */
public void set_ContentTemplateSelector (DataTemplateSelector value)

public function get ContentTemplateSelector () : DataTemplateSelector

public function set ContentTemplateSelector (value : DataTemplateSelector)

 For XAML information, see TemplateBinding Markup Extension. 

Property Value

A DataTemplateSelector object that supplies logic to return a DataTemplate to apply. The default value is a null reference (Nothing in Visual Basic).

Identifier field


Metadata properties set to true


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

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0