FrameworkElementAutomationPeer class

Applies to Windows and Windows Phone

Exposes FrameworkElement derived types (including all controls) to Microsoft UI Automation.

Inheritance

Object
  DependencyObject
    AutomationPeer
      FrameworkElementAutomationPeer

Syntax


public ref class FrameworkElementAutomationPeer : AutomationPeer

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

Members

The FrameworkElementAutomationPeer class has these types of members:

Constructors

The FrameworkElementAutomationPeer class has these constructors.

ConstructorDescription
FrameworkElementAutomationPeer Initializes a new instance of the FrameworkElementAutomationPeer class.

 

Methods

The FrameworkElementAutomationPeer class has these methods. It also inherits methods from the Object class.

MethodDescription
ClearValue Clears the local value of a dependency property. (Inherited from DependencyObject)
CreatePeerForElement Creates a FrameworkElementAutomationPeer for the specified UIElement.
FromElement Returns the FrameworkElementAutomationPeer for the specified UIElement.
GetAcceleratorKey Gets the accelerator key combinations for the object that is associated with the UI Automation peer. (Inherited from AutomationPeer)
GetAcceleratorKeyCore Provides the peer's behavior when a Microsoft UI Automation client calls GetAcceleratorKey or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
GetAccessKey Gets the access key for the element that is associated with the automation peer. (Inherited from AutomationPeer)
GetAccessKeyCore Provides the peer's behavior when a Microsoft UI Automation client calls GetAccessKey or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
GetAnimationBaseValue Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject)
GetAutomationControlType Gets the control type for the element that is associated with the UI Automation peer. (Inherited from AutomationPeer)
GetAutomationControlTypeCore Provides the peer's behavior when a Microsoft UI Automation client calls GetAutomationControlType or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
GetAutomationId Gets the AutomationId of the element that is associated with the automation peer. (Inherited from AutomationPeer)
GetAutomationIdCore Provides the peer's behavior when a Microsoft UI Automation client calls GetAutomationId or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
GetBoundingRectangle Gets the Rect object that represents the screen coordinates of the element that is associated with the automation peer. (Inherited from AutomationPeer)
GetBoundingRectangleCore Provides the peer's behavior when a Microsoft UI Automation client calls GetBoundingRectangle or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
GetChildren Gets the collection of child elements that are represented in the UI Automation tree as immediate child elements of the automation peer. (Inherited from AutomationPeer)
GetChildrenCore Provides the peer's behavior when a Microsoft UI Automation client calls GetChildren or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
GetClassName Gets a name that is used with AutomationControlType, to differentiate the control that is represented by this AutomationPeer. (Inherited from AutomationPeer)
GetClassNameCore Provides the peer's behavior when a Microsoft UI Automation client calls GetClassName or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
GetClickablePoint Gets a point on the element that is associated with the automation peer that responds to a mouse click. (Inherited from AutomationPeer)
GetClickablePointCore Provides the peer's behavior when a Microsoft UI Automation client calls GetClickablePoint or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
GetControlledPeers Provides the peer's behavior when a Microsoft UI Automation client calls GetControlledPeers or an equivalent Microsoft UI Automation client API such as getting a property value as identified by UIA_ControllerForPropertyId. (Inherited from AutomationPeer)
GetControlledPeersCore Gets a list of the controlled peers for the current automation peer. (Inherited from AutomationPeer)
GetHelpText Gets text that describes the functionality of the control that is associated with the automation peer. (Inherited from AutomationPeer)
GetHelpTextCore Provides the peer's behavior when a Microsoft UI Automation client calls GetHelpText or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
GetItemStatus Gets text that conveys the visual status of the element that is associated with this automation peer. (Inherited from AutomationPeer)
GetItemStatusCore Provides the peer's behavior when a Microsoft UI Automation client calls GetItemStatus or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
GetItemType Gets a string that describes what kind of item an element represents. (Inherited from AutomationPeer)
GetItemTypeCore Provides the peer's behavior when a Microsoft UI Automation client calls GetItemType or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
GetLabeledBy Gets the AutomationPeer for the UIElement that is targeted to the element. (Inherited from AutomationPeer)
GetLabeledByCore Provides the peer's behavior when a Microsoft UI Automation client calls GetLabeledBy or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
GetLiveSetting Gets the live setting notification behavior information for the object that is associated with the UI Automation peer. (Inherited from AutomationPeer)
GetLiveSettingCore Provides the peer's behavior when a Microsoft UI Automation client calls GetLiveSetting or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
GetLocalizedControlType Gets a localized string that represents the AutomationControlType value for the control that is associated with this automation peer. (Inherited from AutomationPeer)
GetLocalizedControlTypeCore Provides the peer's behavior when a Microsoft UI Automation client calls GetLocalizedControlType or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
GetName Gets text that describes the element that is associated with this automation peer. The Microsoft UI Automation Name value is the primary identifier used by most assistive technology when they represent your app's UI by interacting with the Microsoft UI Automation framework. (Inherited from AutomationPeer)
GetNameCore Provides the peer's behavior when a Microsoft UI Automation client calls GetName or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
GetOrientation Gets a value that indicates the explicit control orientation, if any. (Inherited from AutomationPeer)
GetOrientationCore Provides the peer's behavior when a Microsoft UI Automation client calls GetOrientation or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
GetParent Gets the AutomationPeer that is the parent of this AutomationPeer. (Inherited from AutomationPeer)
GetPattern Gets the control pattern that is associated with the specified PatternInterface. (Inherited from AutomationPeer)
GetPatternCore Provides the peer's behavior when a Microsoft UI Automation client calls GetPattern or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
GetPeerFromPoint Gets an AutomationPeer from the specified point. (Inherited from AutomationPeer)
GetPeerFromPointCore Provides the peer's behavior when a Microsoft UI Automation client calls GetPeerFromPoint or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
GetValue Returns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject)
HasKeyboardFocus Gets a value that indicates whether the element that is associated with this automation peer currently has keyboard focus. (Inherited from AutomationPeer)
HasKeyboardFocusCore Provides the peer's behavior when a Microsoft UI Automation client calls HasKeyboardFocus or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
InvalidatePeer Triggers recalculation of the main properties of the AutomationPeer and raises the PropertyChanged notification to the automation client if the properties have changed. (Inherited from AutomationPeer)
IsContentElement Gets a value that indicates whether the element that is associated with this automation peer contains data that is presented to the user. (Inherited from AutomationPeer)
IsContentElementCore Provides the peer's behavior when a Microsoft UI Automation client calls IsContentElement or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
IsControlElement Gets a value that indicates whether the element is understood by the user as interactive or as contributing to the logical structure of the control in the GUI. (Inherited from AutomationPeer)
IsControlElementCore Provides the peer's behavior when a Microsoft UI Automation client calls IsControlElement or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
IsEnabled Gets a value that indicates whether the element associated with this automation peer supports interaction. (Inherited from AutomationPeer)
IsEnabledCore Provides the peer's behavior when a Microsoft UI Automation client calls IsEnabled or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
IsKeyboardFocusable Gets a value that indicates whether the element can accept keyboard focus. (Inherited from AutomationPeer)
IsKeyboardFocusableCore Provides the peer's behavior when a Microsoft UI Automation client calls IsKeyboardFocusable or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
IsOffscreen Gets a value that indicates whether an element is off the screen. (Inherited from AutomationPeer)
IsOffscreenCore Provides the peer's behavior when a Microsoft UI Automation client calls IsOffscreen or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
IsPassword Gets a value that indicates whether the element contains sensitive content. (Inherited from AutomationPeer)
IsPasswordCore Provides the peer's behavior when a Microsoft UI Automation client calls IsPassword or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
IsRequiredForForm Gets a value that indicates whether the element that is associated with this peer must be completed on a form. (Inherited from AutomationPeer)
IsRequiredForFormCore Provides the peer's behavior when a Microsoft UI Automation client calls IsRequiredForForm or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
PeerFromProvider Gets an AutomationPeer for the specified IRawElementProviderSimple proxy. (Inherited from AutomationPeer)
ProviderFromPeer Gets the IRawElementProviderSimple proxy for the specified AutomationPeer. (Inherited from AutomationPeer)
RaiseAutomationEvent Raises an automation event. (Inherited from AutomationPeer)
RaisePropertyChangedEvent Raises an event to notify the automation client of a changed property value. (Inherited from AutomationPeer)
ReadLocalValue Returns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject)
SetFocus Sets the keyboard focus on the element that is associated with this automation peer. (Inherited from AutomationPeer)
SetFocusCore Provides the peer's behavior when a Microsoft UI Automation client calls SetFocus or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)
SetValue Sets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject)
ShowContextMenu Shows the available context menu for the owner element. (Inherited from AutomationPeer)
ShowContextMenuCore Provides the peer's behavior when a Microsoft UI Automation client calls ShowContextMenu or an equivalent Microsoft UI Automation client API. (Inherited from AutomationPeer)

 

Properties

The FrameworkElementAutomationPeer class has these properties.

PropertyAccess typeDescription

Dispatcher

Read-onlyGets the CoreDispatcher that this object is associated with. (Inherited from DependencyObject)

EventsSource

Read/writeGets or sets an AutomationPeer that is reported to the automation client as the source for all the events that come from this AutomationPeer. See Remarks. (Inherited from AutomationPeer)

Owner

Read-onlyGets the UIElement owner that is associated with this FrameworkElementAutomationPeer.

 

Remarks

There is no "ControlAutomationPeer" class. FrameworkElementAutomationPeer serves as implementation for all basic Control class scenarios that involve 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 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.

FrameworkElementAutomationPeer derived classes

FrameworkElementAutomationPeer is the parent class for several immediately derived classes that implement peer support for Windows Runtime controls and elements. Some of these peer classes are peers that match control base classes rather than practical controls. For example ButtonBaseAutomationPeer exists so that it can define shared peer behavior for several classes that support the practical Button classes that derive from ButtonBase. Here is the list of classes that directly derive from FrameworkElementAutomationPeer:

Examples

This example shows the basic subclass requirements for deriving a peer from FrameworkElementAutomationPeer and supporting at least one control pattern. This code is an excerpt from the XAML accessibility sample.


// header
        public ref class MediaContainerAP sealed :  Windows::UI::Xaml::Automation::Peers::FrameworkElementAutomationPeer
                                                    ,Windows::UI::Xaml::Automation::Provider::IRangeValueProvider
                                                    ,Windows::UI::Xaml::Automation::Provider::IToggleProvider
        {
// nondefault ctors omitted
        protected: 
            virtual Object^ GetPatternCore(PatternInterface patternInterface) override
            {
                if (patternInterface == PatternInterface::RangeValue)
                {
                    return this;
                }
                else if (patternInterface == PatternInterface::Toggle)
                {
                    return this;
                }
                return nullptr;
            }

        protected:
            virtual  AutomationControlType GetAutomationControlTypeCore() override
            {
                return  AutomationControlType::Group;
            }

        protected:
            virtual Platform::String^ GetLocalizedControlTypeCore() override
            {
                return "Video";
            }
            
        protected:
            virtual Platform::String^ GetClassNameCore() override
            {
                return "MediaElementContainer";
            }
// pattern implementation omitted

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Automation.Peers
Windows::UI::Xaml::Automation::Peers [C++]

Metadata

Windows.winmd

See also

FrameworkElement
Custom automation peers
AutomationPeer
XAML accessibility sample

 

 

Show:
© 2014 Microsoft. All rights reserved.