ToggleSwitch Class
Represents a toggle switch.
Namespace: DevExpress.Xpf.Editors
Assembly: DevExpress.Xpf.Core.v24.1.dll
NuGet Package: DevExpress.Wpf.Core
#Declaration
#Remarks
The ToggleSwitch control consists of a toggle switch and a content area.
#Content
The ToggleSwitch content is specified by the ToggleSwitch.CheckedStateContent, ToggleSwitch.UncheckedStateContent, and ToggleSwitch.UndefinedStateContent properties. The ToggleSwitch.ContentPlacement property specifies the position of the content area within the control.
#ToggleSwitch State
The ToggleSwitch control supports three states (checked, unchecked and indeterminate) if its ToggleSwitch.IsThreeState property is set to true. Otherwise, the control works with the checked and unchecked states only.
The ToggleSwitch.IsChecked property specifies the editor’s state. The toggle switch editor fires the following events when its state changes.
#Optional Toggle Flip Animation
Set the ToggleSwitch.EnableAnimation property to false to disable toggle flip animation.
Note
The Toggle
control is designed to be used in standalone mode.
The ToggleToggle
control within it. You can also use the Toggle
#Appearance Customization
You can use the following properties to customize ToggleSwitch appearances:
Property | Description |
---|---|
Corner |
Gets or sets the Toggle |
Checked |
Gets or sets the content that is displayed when the toggle switch is in the checked state. This is a dependency property. |
Unchecked |
Gets or sets the content that is displayed when the toggle switch is in the unchecked state. |
Checked |
Gets or sets the background brush of the Check |
Checked |
Gets or sets the border brush of the Check |
Border |
Gets or sets a brush that describes the border background of a control. |
Border |
Gets or sets the border thickness of a control. |
Toggle |
Gets or sets the height of the toggle switch. This is a dependency property. |
Toggle |
Gets or sets the width of the toggle switch. This is a dependency property. |
Tip
Refer to the following topic for more information: Appearance Customization