Skip to content

Latest commit

 

History

History
53 lines (37 loc) · 2.05 KB

togglebutton_ischecked.md

File metadata and controls

53 lines (37 loc) · 2.05 KB
-api-id -api-type
P:Windows.UI.Xaml.Controls.Primitives.ToggleButton.IsChecked
winrt property

Windows.UI.Xaml.Controls.Primitives.ToggleButton.IsChecked

-description

Gets or sets whether the ToggleButton is checked.

-xaml-syntax

<togglebutton IsChecked="bool"/>
-or-
<togglebutton IsChecked="{x:Null}"/>

-xaml-values

togglebutton
togglebutton A literal ToggleButton, or a derived type such as CheckBox or RadioButton.

-property-value

true if the ToggleButton is checked; false if the ToggleButton is unchecked; otherwise null. The default is false.

If you are programming using C# or Microsoft Visual Basic, the type of this property is projected as bool? (a nullable Boolean).

-remarks

ToggleButton and can have three states:

StatePropertyValue
checkedIsCheckedtrue
uncheckedIsCheckedfalse
indeterminateIsCheckednull

For the ToggleButton to report the indeterminate state, you must set the IsThreeState property to true.

Note

ToggleButton has the same visual state for the indeterminate and unchecked states. Derived controls, like CheckBox, may define different visual states for each state.

To set the value to null in XAML, use the {x:Null} markup extension.

-examples

-see-also

Nullable, {x:Null} markup extension