Button​Automation​Peer Button​Automation​Peer Button​Automation​Peer Class

Definition

Exposes Button types to Microsoft UI Automation.

public class ButtonAutomationPeer : ButtonBaseAutomationPeer, IButtonAutomationPeer, IInvokeProviderpublic class ButtonAutomationPeer : ButtonBaseAutomationPeer, IButtonAutomationPeer, IInvokeProviderPublic Class ButtonAutomationPeer Inherits ButtonBaseAutomationPeer Implements IButtonAutomationPeer, IInvokeProvider
Inheritance
Attributes
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

Windows.UI.Xaml.Automation.Peers.AutomationPeer.RaiseTextEditTextChangedEvent(Windows.UI.Xaml.Automation.AutomationTextEditChangeType,Windows.Foundation.Collections.IVectorView<System.String>)Windows.UI.Xaml.Automation.Peers.AutomationPeer.RaiseTextEditTextChangedEvent(Windows.UI.Xaml.Automation.AutomationTextEditChangeType,Windows.Foundation.Collections.IVectorView<System.String>)Windows.UI.Xaml.Automation.Peers.AutomationPeer.RaiseTextEditTextChangedEvent(Windows.UI.Xaml.Automation.AutomationTextEditChangeType,Windows.Foundation.Collections.IVectorView<System.String>)

Remarks

The Windows Runtime Button class creates a new ButtonAutomationPeer as its OnCreateAutomationPeer definition. Derive your automation peer from ButtonAutomationPeer if you are deriving a custom class from Button and want to add automation support for additional features that you enabled in your custom class. Then override OnCreateAutomationPeer so that it returns your custom peer.

Default peer implementation and overrides in ButtonAutomationPeer

ButtonAutomationPeer has overrides of Core methods such that the associated AutomationPeer methods provide peer-specific information to a Microsoft UI Automation client.

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.

ButtonAutomationPeer derived classes

ButtonAutomationPeer is the parent class for AppBarButtonAutomationPeer.

Constructors

ButtonAutomationPeer(Button) ButtonAutomationPeer(Button) ButtonAutomationPeer(Button)

Initializes a new instance of the ButtonAutomationPeer class.

public ButtonAutomationPeer(Button owner)public ButtonAutomationPeer(Button owner)Public Sub New(owner As Button)
Parameters
owner
Button Button Button

The owner element to create for.

Attributes

Methods

Invoke() Invoke() Invoke()

Sends a request to click the button associated with the automation peer.

public void Invoke()public void Invoke()Public Function Invoke() As void
Attributes

Remarks

Calls to Invoke should return immediately without blocking. However, this behavior is entirely dependent on the Microsoft UI Automation provider implementation. In scenarios where calling Invoke causes a blocking issue, such as a modal dialog, a separate helper thread may be required to call the method.

See Also