OnOffSwitch
Class in Oadm.Sdk.Client.Controls · Oadm.Sdk.Client.dll
The one On / Off switch (SDK 0.15.0): “On” or “Off” written left of a switch in the accent, as in the Windows 11 settings. The host’s Settings page and the switch of a whole feature in a dialog (Provisioning management) use it. Bind OnOffSwitch.IsChecked two-way; or, when the view model decides (it may refuse), bind it one-way and set OnOffSwitch.Command: a click runs the command and the switch shows OnOffSwitch.IsChecked again once the view model raises it.
public sealed class OnOffSwitch : StackPanelInherits StackPanel
XAML properties
Section titled “XAML properties”Set them in XAML (<ui:OnOffSwitch Name="..." />) or bind them.
| Name | Type | Description |
|---|---|---|
Command |
ICommand? |
Runs on a click, instead of a two-way OnOffSwitch.IsChecked. |
IsChecked |
bool |
Whether the switch is on. |
Constructors
Section titled “Constructors”OnOffSwitch
Section titled “OnOffSwitch”OnOffSwitch()A switch that is off.
Properties
Section titled “Properties”Switch
Section titled “Switch”ToggleSwitch Switch { get; }The switch itself (tests click it).
Fields
Section titled “Fields”OffText
Section titled “OffText”const string OffText = "Off"The text while the switch is off.
OnText
Section titled “OnText”const string OnText = "On"The text while the switch is on.