ContentControl.ContentTemplate ContentControl.ContentTemplate ContentControl.ContentTemplate ContentControl.ContentTemplate Property

Definition

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

public : DataTemplate ContentTemplate { get; set; }
DataTemplate ContentTemplate();

void ContentTemplate(DataTemplate contenttemplate);
public DataTemplate ContentTemplate { get; set; }
Public ReadWrite Property ContentTemplate As DataTemplate
<contentControl>
  <contentControl.ContentTemplate>
    dataTemplate
  </contentControl.ContentTemplate>
</contentControl>
Property Value

The data template that is used to display the content of the ContentControl.

Remarks

Instead of declaring a fixed DataTemplate, you can also implement a DataTemplateSelector and use it to set the ContentTemplateSelector property. This technique enables custom template switching based on input data, at the application level. For more information, see DataTemplateSelector.