ToggleSwitchAutomationPeer
ToggleSwitchAutomationPeer
ToggleSwitchAutomationPeer
ToggleSwitchAutomationPeer
Class
Definition
Exposes ToggleSwitch types to Microsoft UI Automation.
public : class ToggleSwitchAutomationPeer : FrameworkElementAutomationPeer, IToggleSwitchAutomationPeer, IToggleProviderpublic class ToggleSwitchAutomationPeer : FrameworkElementAutomationPeer, IToggleSwitchAutomationPeer, IToggleProviderPublic Class ToggleSwitchAutomationPeer Inherits FrameworkElementAutomationPeer Implements IToggleSwitchAutomationPeer, IToggleProvider// This API is not available in Javascript.
- Inheritance
-
FrameworkElementAutomationPeerFrameworkElementAutomationPeerFrameworkElementAutomationPeerFrameworkElementAutomationPeerToggleSwitchAutomationPeerToggleSwitchAutomationPeerToggleSwitchAutomationPeerToggleSwitchAutomationPeer
- 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 ToggleSwitch class creates a new ToggleSwitchAutomationPeer as its OnCreateAutomationPeer definition. ToggleSwitch is sealed, so the normal scenario of deriving from the ToggleSwitch class and its existing peer isn't applicable to ToggleSwitchAutomationPeer.
Default peer implementation and overrides in ToggleSwitchAutomationPeer
ToggleSwitchAutomationPeer 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 "ToggleSwitch".
- GetAutomationControlType returns AutomationControlType.Button.
- GetLocalizedControlType returns a localized resource string. This is usually handled in FrameworkElementAutomationPeer but ToggleSwitchAutomationPeer has its own implementation. This peer raises toggle-related automation events on behalf of its owner class.
Although a ToggleSwitch can have text content, there is no GetName implementation that can use a string representation. You should set a value for automation Name using the AutomationProperties attached properties.
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.
Constructors
ToggleSwitchAutomationPeer(ToggleSwitch) ToggleSwitchAutomationPeer(ToggleSwitch) ToggleSwitchAutomationPeer(ToggleSwitch) ToggleSwitchAutomationPeer(ToggleSwitch)
Initializes a new instance of the ToggleSwitchAutomationPeer class.
public : ToggleSwitchAutomationPeer(ToggleSwitch owner)public ToggleSwitchAutomationPeer(ToggleSwitch owner)Public Sub New(owner As ToggleSwitch)// This API is not available in Javascript.
The ToggleSwitch to create a peer for.