The Toggle Switch is a graphical element that functions like a physical on-off switch. It allows a user to make a single binary choice, such as enabling or disabling a setting.

A toggle switch has two distinct states: on and off. Users interact by clicking or tapping the switch, which immediately changes its state. A descriptive label is typically used alongside the switch to clarify what option it controls. When linked to data, toggling the switch instantly updates the corresponding value.

On this page:


Requirements

This component is Portable. It runs both on Windows and on Web Pages hosted in any platform.


Configuration

The ToggleSwitch control include options for customizing its behavior and display. These settings control the checkbox's functionality and user interface integration.

  1. Go to Displays / Draw.
  2. On the Components Panel, select Interaction, then ToggleSwitch.
  3. Click or drag-and-drop it on the Drawing area to use it.
  4. Double-click the component to open the configuration window.

ToggleSwitch Settings

Field

Description

Label Text

Specifies the text displayed next to the ToggleSwitch.

Localize

Enables the label text to be dynamically adjusted based on the user’s locale settings, ensuring the interface is accessible and understandable for users from different language backgrounds

Linked Value

Associates the ToggleSwitch with a tag, enumeration, value, or object. This linkage means that the state of the ToggleSwitch (checked or unchecked) will reflect the changes in the selected object in your application.

Thumb Background

Changes the main color for the switch state indicator.

Active Background

Changes the background color when the switch state is active.

Inactive Background

Changes the background color when the switch state is inactive.

Is Read Only

Makes the ToggleSwitch non-interactive, meaning users cannot change its state by clicking on it. When this option is enabled, the ToggleSwitch is displayed in a way that shows its current state (checked or unchecked) but does not allow the user to modify it.

Label Position

Determines the position of the label text relative to the ToggleSwitch. There are two options:

After: The label text appears to the right of the ToggleSwitch. This is the most common layout, often used to improve readability and alignment in forms and user interfaces.

Before: The label text appears to the left of the ToggleSwitch.

When the "Label Position" property is set to "Before" in the TToggleSwitch control, the FlowDirection property is automatically changed to RightToLeft. FrameworkElement.FlowDirection Property (System.Windows)
This behavior causes the ToggleSwitch tick mark to appear inverted, which is expected for right-to-left layouts.


Runtime Execution 

When a user interacts with a toggle switch, the application updates its state to either on or off. This action prompts the solution to enable or disable a specific setting or feature. For instance, a user might flip a toggle switch to activate a sensor or change an operational mode.



In this section: