ContentPresenter.ContentTemplate Property

Definition

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

Equivalent WinUI property: Microsoft.UI.Xaml.Controls.ContentPresenter.ContentTemplate.

DataTemplate ContentTemplate();

void ContentTemplate(DataTemplate value);
public DataTemplate ContentTemplate { get; set; }
var dataTemplate = contentPresenter.contentTemplate;
contentPresenter.contentTemplate = dataTemplate;
Public Property ContentTemplate As DataTemplate
<ContentPresenter ContentTemplate="{Binding}"/>

Property Value

DataTemplate

A DataTemplate that defines the visualization of the content. The default is null.

Applies to