Table of Contents

ToggleButton

toggle toggle


Inherits from Control.


Property:


Click
Specifies the name of the Function to call when the user clicks the ToggleButton.

Example

<ToggleButton Name="ToggleButton1" Text="Click me" Click="ShowAlert"/>

This example shows how to call a function when the ToggleButton is clicked, passing an argument.

<ToggleButton Name="ToggleButton1" Text="Click me" Click="ShowAlert('My message')"/>

Disabled

Use the Disabled property to disable a control or set it to read-only.
The disabled property support data binding or an explicit value (true, false).

Example

<ToggleButton Disabled="{Binding Path:Customer.NotActive}"/>
or
<ToggleButton Disabled="true"/>

You cannot use both a Binding AND the control APIs at the same time to set the disabled state of a control.
If the Disabled property of a control has a Binding, using the control.Disable() or control.Enable() APIs will not work (binding will win).

Valid values for the Disabled property:

  • True
  • False
  • {Binding}

Text
The text to display in the user interface.


TextCode The text code used for translation, to resolve the value to display in the user interface. If the text code for the current user language cannot be found, the value in the Text property is displayed.


TextExpression A C# expression that returns a string. If this expression returns a string, this value overrides the TextCode and Text property.


Value

Valid for the Value property:

  • True
  • False
  • {Binding}

Example

<ToggleButton Name="Toggle_IsHappy" Value="{Binding Path:ToggleButtonSource.IsHappy}" />

Hotkey

Specifies the hotkey for the control.
Example

<Input Hotkey="Alt+T"/>

img


Videos