ToggleSwitch.OnContent property

Applies to Windows and Windows Phone

Provides the object content that should be displayed using the OnContentTemplate when this ToggleSwitch has state of "On".

Syntax


public object OnContent { get; set; }


<ToggleSwitch OnContent="stringContent"/>


<ToggleSwitch>
  <ToggleSwitch.OnContent>
    singleContentElement
  </ToggleSwitch.OnContent>
</ToggleSwitch>

XAML Values

stringContent

A string that declares the "On "state content. Can also be a reference to a resource, which might be a string or could also be a composited object.

singleContentElement

A single object element for a class that derives from UIElement and can be handled by the default ContentPresenter.

Property value

Type: System.Object [.NET] | Platform::Object [C++]

The object content. In some cases this is a string, in other cases it is a single element that provides a root for further composition content. Probably the most common "set" usage is to place a binding here.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

See also

ToggleSwitch

 

 

Show:
© 2014 Microsoft