Skip to content

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 : StackPanel

Inherits StackPanel

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.
OnOffSwitch()

A switch that is off.

ToggleSwitch Switch { get; }

The switch itself (tests click it).

const string OffText = "Off"

The text while the switch is off.

const string OnText = "On"

The text while the switch is on.