IsChecked property
Collapse the table of content
Expand the table of content

ToggleButton.IsChecked property

Gets or sets whether the ToggleButton is checked.

Syntax


public Nullable<bool> IsChecked { get; set; }


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

XAML Values

togglebutton

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

Property value

Type: IReference<Boolean> [C++] | System.Nullable<Boolean> [.NET]

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 Visual Basic, the type of this property is projected as bool? (a nullable Boolean).

Remarks

ToggleButton and can have three states:

StatePropertyValue

checked

IsCheckedtrue

unchecked

IsCheckedfalse

indeterminate

IsCheckednull

 

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.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.UI.Xaml.Controls.Primitives
Windows::UI::Xaml::Controls::Primitives [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls.Primitives
Windows::UI::Xaml::Controls::Primitives [C++]

Metadata

Windows.winmd

See also

ToggleButton
Nullable
{x:Null} markup extension

 

 

Show:
© 2016 Microsoft