ToggleSwitch.OnContentTemplate Property

Definition

Gets or sets the DataTemplate used to display the control's content while in "On" state.

Equivalent WinUI property: Microsoft.UI.Xaml.Controls.ToggleSwitch.OnContentTemplate.

DataTemplate OnContentTemplate();

void OnContentTemplate(DataTemplate value);
public DataTemplate OnContentTemplate { get; set; }
var dataTemplate = toggleSwitch.onContentTemplate;
toggleSwitch.onContentTemplate = dataTemplate;
Public Property OnContentTemplate As DataTemplate
<ToggleSwitch>
  <ToggleSwitch.OnContentTemplate>
    singleDataTemplate
  </ToggleSwitch.OnContentTemplate>
</ToggleSwitch>
- or -
<ToggleSwitch OnContentTemplate="resourceReferenceToDataTemplate"/>

Property Value

DataTemplate

The DataTemplate that displays the control's content while in "On" state.

Applies to