This topic demonstrates how to use RadToggleSwitch and how to customize it.
The following namespace must be declared in order to use RadToggleSwitch:
Here is how RadToggleSwitch is declared in XAML:
RadToggleSwitch inherits from HeaderedContentControl and provides only four unique properties with which
it can be customized. These are Command, CommandParameter,
ButtonStyle and IsChecked.
The Command property allows users to associate an object that implements the ICommand interface with
RadToggleSwitch. This command will then be executed when the toggle switch is switched on or off.
When RadToggleSwitch's Command is to be executed the value of this
property will be passed as the command's parameter. If this property is not set,
the command parameter will be true if the toggle switch
is checked and false if it is unchecked.
Since RadToggleSwitch inherits from HeaderedContentControl it consists of a header part and a
button part. The ButtonStyle property allows users to provide a unique style only for the button part
The IsChecked property toggles the state of RadToggleSwitch from checked to unchecked and vice versa.