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
IXRToggleButton
Methods
Method |
Description |
---|---|
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. |
|
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. |
|
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. |
|
Retrieves a value that indicates whether this toggle button is in a checked state. |
|
Retrieves a value that indicates whether this toggle button supports two or three states. |
|
Removes a delegate from the Checked event for this toggle button. |
|
Removes a delegate from the Indeterminate event for this toggle button. |
|
Removes a delegate from the Unchecked event for this toggle button. |
|
Sets a value that indicates whether this toggle button is in a checked state. |
|
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 |