ToggleButtonAutomationPeer ToggleButtonAutomationPeer ToggleButtonAutomationPeer ToggleButtonAutomationPeer Class


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.
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Inherited Members

Inherited methods

Inherited properties


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.

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:


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.


ToggleState ToggleState ToggleState ToggleState

Gets the toggle state of the control.

public : ToggleState ToggleState { get; }public ToggleState ToggleState { get; }Public ReadOnly Property ToggleState As ToggleState// This API is not available in Javascript.
ToggleState ToggleState ToggleState ToggleState

The toggle state of the control.


Toggle() Toggle() Toggle() Toggle()

Cycles through the toggle states of a control.

public : void Toggle()public void Toggle()Public Function Toggle() As void// This API is not available in Javascript.

See Also