Compartilhar via


IXRToggleButton (Compact 2013)

3/28/2014

This class represents the base class for button controls that can switch states.

Syntax

class IXRToggleButton : public IXRButtonBase

Inheritance Hierarchy

IXRDependencyObject

    IXRUIElement

        IXRFrameworkElement

            IXRControl

                IXRContentControl

                    IXRButtonBase

                        IXRToggleButton

                            IXRRadioButton

                            IXRCheckBox

Methods

Method

Description

IXRToggleButton::AddCheckedEventHandler

Attaches a delegate to the Checked event for this toggle button. When the Checked event is raised by this toggle button, this delegate will be invoked.

IXRToggleButton::AddIndeterminateEventHandler

Attaches a delegate to the Indeterminate event for this toggle button. When the Indeterminate event is raised by this toggle button, this delegate will be invoked.

IXRToggleButton::AddUncheckedEventHandler

Attaches a delegate to the Unchecked event for this toggle button. When the Unchecked event is raised by this toggle button, this delegate will be invoked.

IXRToggleButton::GetIsChecked

Retrieves a value that indicates whether this toggle button is in a checked state.

IXRToggleButton::GetIsThreeState

Retrieves a value that indicates whether this toggle button supports two or three states.

IXRToggleButton::RemoveCheckedEventHandler

Removes a delegate from the Checked event for this toggle button.

IXRToggleButton::RemoveIndeterminateEventHandler

Removes a delegate from the Indeterminate event for this toggle button.

IXRToggleButton::RemoveUncheckedEventHandler

Removes a delegate from the Unchecked event for this toggle button.

IXRToggleButton::SetIsChecked

Sets a value that indicates whether this toggle button is in a checked state.

IXRToggleButton::SetIsThreeState

Sets a value that indicates whether this toggle button supports two or three states.

Thread Safety

Members of this class are thread-safe if you previously called IXRApplication::CreateHostFromXaml and supplied it with an XRWindowCreateParams structure that has AllowsMultipleThreadAccess set to true.

Remarks

The IXRToggleButton class represents a toggle button that can switch to multiple states. The toggle button switches to another state when a user clicks on it. IXRToggleButton is the base class for IXRCheckBox and IXRRadioButton.

A toggle button can change its state to a maximum of three different states. For example, you could use a three-state toggle button to support "Yes", "No", and "Not Applicable" options for the user to choose from. When the toggle button raises a Checked event, you can query the state of the sending object to determine how to handle the event.

To access or modify the current state of this toggle button, use the methods IXRToggleButton::GetIsChecked and IXRToggleButton::SetIsChecked.

A toggle button can be configured to have three states, which enables the user to select a third, indeterminate state for the button by clicking it. To determine whether this toggle button has two or three states, call IXRToggleButton::GetIsThreeState. To enable the indeterminate state, call IXRToggleButton::SetIsThreeState.

When you create a class instance, use an IXRToggleButtonPtr smart pointer instead of a raw interface pointer. For more information, see XRPtr<Interface>.

You can also define a toggle button in Microsoft Silverlight 3 XAML. For information about the differences between XAML in XAML for Windows Embedded and Silverlight 3, see Differences Between Microsoft Silverlight 3 and XAML for Windows Embedded. For more information about how to define this element in the source XAML for your application, see the ToggleButton Class on MSDN.

.NET Framework Equivalent

System.Windows.Controls.Primitives.ToggleButton

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

Classes for UI Element Management