ToggleButtonAutomationPeer ToggleButtonAutomationPeer ToggleButtonAutomationPeer Class

Exposes ToggleButton types to Microsoft UI Automation.

Syntax

Declaration

public class ToggleButtonAutomationPeerpublic class ToggleButtonAutomationPeerPublic Class ToggleButtonAutomationPeer

Inheritance Hierarchy

Inherited Members

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

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.

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 summary

Initializes a new instance of the ToggleButtonAutomationPeer class.

Properties summary

Gets the toggle state of the control.

Methods summary

Cycles through the toggle states of a control.

Constructors

  • ToggleButtonAutomationPeer(Windows.UI.Xaml.Controls.Primitives.ToggleButton)
    ToggleButtonAutomationPeer(Windows.UI.Xaml.Controls.Primitives.ToggleButton)
    ToggleButtonAutomationPeer(Windows.UI.Xaml.Controls.Primitives.ToggleButton)
    ToggleButtonAutomationPeer(Windows.UI.Xaml.Controls.Primitives.ToggleButton)

    Initializes a new instance of the ToggleButtonAutomationPeer class.

    public ToggleButtonAutomationPeer(Windows.UI.Xaml.Controls.Primitives.ToggleButton owner)public ToggleButtonAutomationPeer(Windows.UI.Xaml.Controls.Primitives.ToggleButton owner)Public Function ToggleButtonAutomationPeer(owner As Windows.UI.Xaml.Controls.Primitives.ToggleButton) As

    Parameters

Properties

  • 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

    Property Value

Methods

  • Toggle()
    Toggle()
    Toggle()
    Toggle()

    Cycles through the toggle states of a control.

    public void Toggle()public void Toggle()Public Function Toggle() As void

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ComposableAttribute

Details

Assembly

Windows.UI.Xaml.Automation.Peers.dll