ToggleSwitch
Note: You can check the Avalonia docs for the ToggleSwitch API if you need more information.
For Avalonia.FuncUI's DSL properties you can check ToggleSwitch.fs
A ToggleSwitch
is a switch that toggles between on (checked) and off (unchecked) states. This control functions similarly to a CheckBox but displays the content with an on/off slider instead.
Usage
Create a ToggleSwitch
Register State Change
Handle state changes Separately
Tristate Toggling
ToggleSwitch.isChecked
can take values that are bool
, Nullable<bool>
, or bool option
. When using tristate options however, you must use either Nullable<bool>
or bool option
. You can also handle each event state like above using onChecked
, onUncheked
, and onIndeterminate
.
Last updated