ContentTemplate Property
Collapse the table of content
Expand the table of content

ContentPresenter.ContentTemplate Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets or sets the template that is used to display the content of the control.

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.

public DataTemplate ContentTemplate { get; set; }
<ContentPresenter ContentTemplate="{Binding}"/>

Property Value

Type: System.Windows.DataTemplate
A DataTemplate that defines the visualization of the content. The default is null.

Dependency property identifier field: ContentTemplateProperty

The XAML usage shown is the necessary when a ContentPresenter is part of a DataTemplate. When a ContentPresenter is part of a ControlTemplate, you do not need to template bind the ContentTemplate property.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2017 Microsoft