ToggleButtonAutomationPeer
ToggleButtonAutomationPeer
ToggleButtonAutomationPeer
ToggleButtonAutomationPeer
Class
Definition
Exposes ToggleButton types to Microsoft UI Automation.
public : class ToggleButtonAutomationPeer : ButtonBaseAutomationPeer, IToggleButtonAutomationPeer, IToggleProviderpublic class ToggleButtonAutomationPeer : ButtonBaseAutomationPeer, IToggleButtonAutomationPeer, IToggleProviderPublic Class ToggleButtonAutomationPeer Inherits ButtonBaseAutomationPeer Implements IToggleButtonAutomationPeer, IToggleProvider// This API is not available in Javascript.
- Inheritance
-
FrameworkElementAutomationPeerFrameworkElementAutomationPeerFrameworkElementAutomationPeerFrameworkElementAutomationPeerToggleButtonAutomationPeerToggleButtonAutomationPeerToggleButtonAutomationPeerToggleButtonAutomationPeer
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Inherited Members
Inherited methods
Inherited properties
Remarks
The Windows Runtime ToggleButton class creates a new ToggleButtonAutomationPeer as its OnCreateAutomationPeer definition.
ToggleButton has several derived classes such as RadioButton, which have template support and practical implementations of some important functionality. Make sure that you really want to derive from the base class. If you're sure you want to derive from ToggleButton, directly, derive your automation peer from ToggleButtonAutomationPeer and override OnCreateAutomationPeer so that it returns your custom peer.
Default peer implementation and overrides in ToggleButtonAutomationPeer
ToggleButtonAutomationPeer has overrides of Core methods such that the associated AutomationPeer methods provide peer-specific information to a Microsoft UI Automation client.
- GetPattern reports that the peer provides pattern support for PatternInterface.Toggle (IToggleProvider ).
- GetClassName returns "ToggleButton".
- GetAutomationControlType returns AutomationControlType.Button. This peer raises toggle-related automation events on behalf of its owner class.
This peer has the base class ButtonBaseAutomationPeer and inherits behavior other than the overrides indicated above. Notably, GetName returns a string value based on examining the current Content. For more info, see ButtonBaseAutomationPeer.
The peer also has other behaviors that are provided by the base FrameworkElementAutomationPeer class. For more info, see "Base implementation in FrameworkElementAutomationPeer" section of Custom automation peers.
ToggleButtonAutomationPeer derived classes
ToggleButtonAutomationPeer is the parent class for several immediately derived classes that implement peer support for Windows Runtime controls. Here is the list of classes that directly derive from ToggleButtonAutomationPeer:
Constructors
ToggleButtonAutomationPeer(ToggleButton) ToggleButtonAutomationPeer(ToggleButton) ToggleButtonAutomationPeer(ToggleButton) ToggleButtonAutomationPeer(ToggleButton)
Initializes a new instance of the ToggleButtonAutomationPeer class.
public : ToggleButtonAutomationPeer(ToggleButton owner)public ToggleButtonAutomationPeer(ToggleButton owner)Public Sub New(owner As ToggleButton)// This API is not available in Javascript.
The ToggleButton to create a peer for.