ButtonBaseAutomationPeer ButtonBaseAutomationPeer ButtonBaseAutomationPeer ButtonBaseAutomationPeer Class


Represents a base class for exposing classes derived from ButtonBase to Microsoft UI Automation.

public : class ButtonBaseAutomationPeer : FrameworkElementAutomationPeer, IButtonBaseAutomationPeerpublic class ButtonBaseAutomationPeer : FrameworkElementAutomationPeer, IButtonBaseAutomationPeerPublic Class ButtonBaseAutomationPeer Inherits FrameworkElementAutomationPeer Implements IButtonBaseAutomationPeer// 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


ButtonBaseAutomationPeer has a protected constructor, so you won't be able to use it directly for an OnCreateAutomationPeer definition. Derive your automation peer from ButtonBaseAutomationPeer if you are deriving a custom class from ButtonBase 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. Note that ButtonBase already has derived classes, each of which also has a derived peer, so make sure that you really want to derive from this base class rather than use one of the existing XAML-enabled derived button classes.

Default peer implementation and overrides in ButtonBaseAutomationPeer

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

There is no "ControlAutomationPeer" class. FrameworkElementAutomationPeer serves as implementation for all basic Control class scenarios that involve Microsoft UI Automation. This includes behavior that does not necessarily appear as a public API exposure, such as the practical implementations of many of the Core methods from AutomationPeer.

FrameworkElementAutomationPeer includes extensive base implementation of peer behavior that other peers can use to report information that comes from owner classes at the UIElement and FrameworkElement level. For more info, see "Base implementation in FrameworkElementAutomationPeer" section of Custom automation peers.

In addition to the Core overrides, FrameworkElementAutomationPeer has two static utility methods that are useful for getting a peer handle from within control code, or for generating items peers from an item container peer for Microsoft UI Automation support. These are:

If you have a need to define a custom automation peer and can't identify a more derived peer class that pairs up with the control or base class you are deriving the owner class from, you should base your peer on FrameworkElementAutomationPeer. Even if the owner class isn't necessarily a FrameworkElement, you can't practically derive peers from AutomationPeer directly because FrameworkElementAutomationPeer has many overrides that provide the expected behavior for layout, automation and UI interactions. You do need to derive your owner class from UIElement at least, otherwise there is no way to create the peer on automation tree load with OnCreateAutomationPeer.

ButtonBaseAutomationPeer derived classes

ButtonBaseAutomationPeer 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 ButtonBaseAutomationPeer:


ButtonBaseAutomationPeer(ButtonBase) ButtonBaseAutomationPeer(ButtonBase) ButtonBaseAutomationPeer(ButtonBase) ButtonBaseAutomationPeer(ButtonBase)

Provides base class initialization behavior for ButtonBase derived classes.

protected : ButtonBaseAutomationPeer(ButtonBase owner)protected ButtonBaseAutomationPeer(ButtonBase owner)Protected Sub New(owner As ButtonBase)// This API is not available in Javascript.
ButtonBase ButtonBase ButtonBase ButtonBase

The owner element to create for.

See Also