Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

FrameworkElementAutomationPeer Class

Exposes FrameworkElement types (including controls) to UI automation.

System.Object
  System.Windows.DependencyObject
    System.Windows.Automation.Peers.AutomationPeer
      System.Windows.Automation.Peers.FrameworkElementAutomationPeer
        More...

Namespace:  System.Windows.Automation.Peers
Assembly:  System.Windows (in System.Windows.dll)
public class FrameworkElementAutomationPeer : AutomationPeer

The FrameworkElementAutomationPeer type exposes the following members.

  NameDescription
Public methodSupported by Silverlight for Windows PhoneFrameworkElementAutomationPeerInitializes a new instance of the FrameworkElementAutomationPeer class.
Top
  NameDescription
Public propertySupported by Silverlight for Windows PhoneDispatcherGets the Dispatcher this object is associated with. (Inherited from DependencyObject.)
Public propertySupported by Silverlight for Windows PhoneEventsSourceGets or sets an AutomationPeer that is reported to the automation client as a source for all the events that come from this AutomationPeer. (Inherited from AutomationPeer.)
Public propertySupported by Silverlight for Windows PhoneOwnerGets the UIElement that is associated with this FrameworkElementAutomationPeer.
Top
  NameDescription
Public methodSupported by Silverlight for Windows PhoneCheckAccessDetermines whether the calling thread has access to this object. (Inherited from DependencyObject.)
Public methodSupported by Silverlight for Windows PhoneClearValueClears the local value of a dependency property. (Inherited from DependencyObject.)
Public methodStatic memberSupported by Silverlight for Windows PhoneCreatePeerForElementCreates a FrameworkElementAutomationPeer for the specified UIElement.
Public methodSupported by Silverlight for Windows PhoneEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows PhoneFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodStatic memberSupported by Silverlight for Windows PhoneFromElementReturns the FrameworkElementAutomationPeer for the specified UIElement.
Public methodSupported by Silverlight for Windows PhoneGetAcceleratorKeyGets the accelerator key combination for the object that is associated with the UI Automation peer. (Inherited from AutomationPeer.)
Protected methodSupported by Silverlight for Windows PhoneGetAcceleratorKeyCoreReturns the accelerator key for the UIElement that is associated with this FrameworkElementAutomationPeer. This method is called by GetAcceleratorKey. (Overrides AutomationPeer.GetAcceleratorKeyCore().)
Public methodSupported by Silverlight for Windows PhoneGetAccessKeyGets the access key for the object that is associated with the automation peer. (Inherited from AutomationPeer.)
Protected methodSupported by Silverlight for Windows PhoneGetAccessKeyCoreReturns the access key for the UIElement that is associated with this FrameworkElementAutomationPeer. This method is called by GetAccessKey. (Overrides AutomationPeer.GetAccessKeyCore().)
Public methodSupported by Silverlight for Windows PhoneGetAnimationBaseValueReturns any base value established for a Silverlight dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject.)
Public methodSupported by Silverlight for Windows PhoneGetAutomationControlTypeGets the control type for the object that is associated with the UI Automation peer. (Inherited from AutomationPeer.)
Protected methodSupported by Silverlight for Windows PhoneGetAutomationControlTypeCoreReturns the control type for the UIElement that is associated with this FrameworkElementAutomationPeer. This method is called by GetAutomationControlType. (Overrides AutomationPeer.GetAutomationControlTypeCore().)
Public methodSupported by Silverlight for Windows PhoneGetAutomationIdGets the AutomationId of the object that is associated with the automation peer. (Inherited from AutomationPeer.)
Protected methodSupported by Silverlight for Windows PhoneGetAutomationIdCoreReturns the string that uniquely identifies the FrameworkElement that is associated with this FrameworkElementAutomationPeer. This method is called by GetAutomationId. (Overrides AutomationPeer.GetAutomationIdCore().)
Public methodSupported by Silverlight for Windows PhoneGetBoundingRectangleGets the Rect object that represents the screen coordinates of the element that is associated with the automation peer. (Inherited from AutomationPeer.)
Protected methodSupported by Silverlight for Windows PhoneGetBoundingRectangleCoreReturns the Rect that represents the bounding rectangle of the UIElement that is associated with this FrameworkElementAutomationPeer. This method is called by GetBoundingRectangle. (Overrides AutomationPeer.GetBoundingRectangleCore().)
Public methodSupported by Silverlight for Windows PhoneGetChildrenGets the collection of child elements that are represented in the UI Automation tree as immediate child elements of the automation peer. (Inherited from AutomationPeer.)
Protected methodSupported by Silverlight for Windows PhoneGetChildrenCoreReturns the collection of child elements of the UIElement that is associated with this FrameworkElementAutomationPeer. This method is called by GetChildren. (Overrides AutomationPeer.GetChildrenCore().)
Public methodSupported by Silverlight for Windows PhoneGetClassNameGets the name of the control class that is associated with the peer. (Inherited from AutomationPeer.)
Protected methodSupported by Silverlight for Windows PhoneGetClassNameCoreReturns the name of the UIElement that is associated with this FrameworkElementAutomationPeer. This method is called by GetClassName. (Overrides AutomationPeer.GetClassNameCore().)
Public methodSupported by Silverlight for Windows PhoneGetClickablePointGets a Point on the object that is associated with the automation peer that responds to a mouse click. (Inherited from AutomationPeer.)
Protected methodSupported by Silverlight for Windows PhoneGetClickablePointCoreReturns a Point that represents the clickable space that is on the UIElement that is associated with this FrameworkElementAutomationPeer. This method is called by GetClickablePoint. (Overrides AutomationPeer.GetClickablePointCore().)
Public methodSupported by Silverlight for Windows PhoneGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneGetHelpTextGets text that describes the functionality of the control that is associated with the automation peer. (Inherited from AutomationPeer.)
Protected methodSupported by Silverlight for Windows PhoneGetHelpTextCoreReturns the string that describes the functionality of the FrameworkElement that is associated with this FrameworkElementAutomationPeer. This method is called by GetHelpText. (Overrides AutomationPeer.GetHelpTextCore().)
Public methodSupported by Silverlight for Windows PhoneGetItemStatusGets text that conveys the visual status of the object that is associated with this automation peer. (Inherited from AutomationPeer.)
Protected methodSupported by Silverlight for Windows PhoneGetItemStatusCoreReturns a string that communicates the visual status of the UIElement that is associated with this FrameworkElementAutomationPeer. This method is called by GetItemStatus. (Overrides AutomationPeer.GetItemStatusCore().)
Public methodSupported by Silverlight for Windows PhoneGetItemTypeGets a string that describes what kind of item an element represents. (Inherited from AutomationPeer.)
Protected methodSupported by Silverlight for Windows PhoneGetItemTypeCoreReturns a human-readable string that contains the item type that the UIElement for this FrameworkElementAutomationPeer represents. This method is called by GetItemType. (Overrides AutomationPeer.GetItemTypeCore().)
Public methodSupported by Silverlight for Windows PhoneGetLabeledByGets the AutomationPeer for the UIElement that is targeted to the element. (Inherited from AutomationPeer.)
Protected methodSupported by Silverlight for Windows PhoneGetLabeledByCoreReturns the AutomationPeer for the UIElement that targets the FrameworkElement that is associated with this FrameworkElementAutomationPeer. This method is called by GetLabeledBy. (Overrides AutomationPeer.GetLabeledByCore().)
Public methodSupported by Silverlight for Windows PhoneGetLocalizedControlTypeGets a localized string that represents the control type, for the control that is associated with this automation peer. The localized string parallels a AutomationControlType value. (Inherited from AutomationPeer.)
Protected methodSupported by Silverlight for Windows PhoneGetLocalizedControlTypeCoreReturns a localized human-readable string that identifies a control type. The control type is for the owner type that is associated with this FrameworkElementAutomationPeer. This method is called by GetLocalizedControlType. (Overrides AutomationPeer.GetLocalizedControlTypeCore().)
Public methodSupported by Silverlight for Windows PhoneGetNameGets the value that the automation peer reports as the UI Automation Name for the associated control. (Inherited from AutomationPeer.)
Protected methodSupported by Silverlight for Windows PhoneGetNameCoreReturns the UI Automation Name from the element that is associated with this FrameworkElementAutomationPeer. This method is called by GetName. (Overrides AutomationPeer.GetNameCore().)
Public methodSupported by Silverlight for Windows PhoneGetOrientationGets a value that indicates the explicit control orientation, if any. (Inherited from AutomationPeer.)
Protected methodSupported by Silverlight for Windows PhoneGetOrientationCoreReturns a value that indicates whether the element that is associated with this FrameworkElementAutomationPeer is laid out in a specific direction. This method is called by GetOrientation. (Overrides AutomationPeer.GetOrientationCore().)
Public methodSupported by Silverlight for Windows PhoneGetParentGets the AutomationPeer that is the parent of this AutomationPeer. (Inherited from AutomationPeer.)
Public methodSupported by Silverlight for Windows PhoneGetPatternReturns an object that supports the requested pattern, based on the patterns supported by this FrameworkElementAutomationPeer. (Overrides AutomationPeer.GetPattern(PatternInterface).)
Public methodSupported by Silverlight for Windows PhoneGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneGetValueReturns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject.)
Public methodSupported by Silverlight for Windows PhoneHasKeyboardFocusGets a value that indicates whether the object that is associated with this automation peer currently has keyboard focus. (Inherited from AutomationPeer.)
Protected methodSupported by Silverlight for Windows PhoneHasKeyboardFocusCoreReturns a value that indicates whether the UIElement that is associated with this FrameworkElementAutomationPeer currently has keyboard input focus. This method is called by HasKeyboardFocus. (Overrides AutomationPeer.HasKeyboardFocusCore().)
Public methodSupported by Silverlight for Windows PhoneInvalidatePeerTriggers 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.)
Public methodSupported by Silverlight for Windows PhoneIsContentElementGets a value that indicates whether the object that is associated with this automation peer contains data that is presented to the user. (Inherited from AutomationPeer.)
Protected methodSupported by Silverlight for Windows PhoneIsContentElementCoreReturns a value that indicates whether the element that is associated with this FrameworkElementAutomationPeer is an element that contains data that is presented to the user. This method is called by IsContentElement. (Overrides AutomationPeer.IsContentElementCore().)
Public methodSupported by Silverlight for Windows PhoneIsControlElementGets 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.)
Protected methodSupported by Silverlight for Windows PhoneIsControlElementCoreReturns a value that indicates whether the object that is associated with this FrameworkElementAutomationPeer is understood by the end user as interactive. Optionally, the user might understand the object as contributing to the logical structure of the control in the GUI. This method is called by IsControlElement. (Overrides AutomationPeer.IsControlElementCore().)
Public methodSupported by Silverlight for Windows PhoneIsEnabledGets a value that indicates whether the element associated with this automation peer supports interaction. (Inherited from AutomationPeer.)
Protected methodSupported by Silverlight for Windows PhoneIsEnabledCoreReturns a value that indicates whether the UIElement that is associated with this FrameworkElementAutomationPeer is enabled. This method is called by IsEnabled. (Overrides AutomationPeer.IsEnabledCore().)
Public methodSupported by Silverlight for Windows PhoneIsKeyboardFocusableGets a value that indicates whether the element can accept keyboard focus. (Inherited from AutomationPeer.)
Protected methodSupported by Silverlight for Windows PhoneIsKeyboardFocusableCoreReturns a value that indicates whether the element that is associated with this FrameworkElementAutomationPeer can accept keyboard focus. This method is called by IsKeyboardFocusable. (Overrides AutomationPeer.IsKeyboardFocusableCore().)
Public methodSupported by Silverlight for Windows PhoneIsOffscreenGets a value that indicates whether an element is off the screen. (Inherited from AutomationPeer.)
Protected methodSupported by Silverlight for Windows PhoneIsOffscreenCoreReturns a value that indicates whether the UIElement that is associated with this FrameworkElementAutomationPeer is off the screen. This method is called by IsOffscreen. (Overrides AutomationPeer.IsOffscreenCore().)
Public methodSupported by Silverlight for Windows PhoneIsPasswordGets a value that indicates whether the element contains sensitive content. (Inherited from AutomationPeer.)
Protected methodSupported by Silverlight for Windows PhoneIsPasswordCoreReturns a value that indicates whether the element that is associated with this FrameworkElementAutomationPeer contains protected content. This method is called by IsPassword. (Overrides AutomationPeer.IsPasswordCore().)
Public methodSupported by Silverlight for Windows PhoneIsRequiredForFormGets a value that indicates whether the object that is associated with this peer must be completed on a form. (Inherited from AutomationPeer.)
Protected methodSupported by Silverlight for Windows PhoneIsRequiredForFormCoreReturns a value that indicates whether the element that is associated with this FrameworkElementAutomationPeer is required to be completed on a form. This method is called by IsRequiredForForm. (Overrides AutomationPeer.IsRequiredForFormCore().)
Protected methodSupported by Silverlight for Windows PhoneMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows PhonePeerFromProviderGets an AutomationPeer for the specified IRawElementProviderSimple proxy. (Inherited from AutomationPeer.)
Protected methodSupported by Silverlight for Windows PhoneProviderFromPeerGets the IRawElementProviderSimple proxy for the specified AutomationPeer. (Inherited from AutomationPeer.)
Public methodSupported by Silverlight for Windows PhoneRaiseAutomationEventRaises an automation event. (Inherited from AutomationPeer.)
Public methodSupported by Silverlight for Windows PhoneRaisePropertyChangedEventRaises an event to notify the automation client of a changed property value. (Inherited from AutomationPeer.)
Public methodSupported by Silverlight for Windows PhoneReadLocalValueReturns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject.)
Public methodSupported by Silverlight for Windows PhoneSetFocusSets the keyboard focus on the object that is associated with this automation peer. (Inherited from AutomationPeer.)
Protected methodSupported by Silverlight for Windows PhoneSetFocusCoreSets the keyboard input focus on the element that is associated with this FrameworkElementAutomationPeer. This method is called by SetFocus. (Overrides AutomationPeer.SetFocusCore().)
Public methodSupported by Silverlight for Windows PhoneSetValueSets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject.)
Public methodSupported by Silverlight for Windows PhoneToStringReturns a string that represents the current object. (Inherited from Object.)
Top

Most controls use this class as the base for their automation peer class. In addition, UI Automation support can be added for classes that are strictly speaking not derived from the Silverlight Control class.

FrameworkElementAutomationPeer *Core Method Implementations

Each of the *Core methods implemented by FrameworkElementAutomationPeer have a simple implementation. These implementations reference native code of the Silverlight codebase. In several cases, the implementations make it possible for the instance-specific AutomationProperties attached property values from XAML and usercode to provide information to an automation peer at runtime.

The FrameworkElementAutomationPeer *Core methods that correspond to a AutomationProperties attached property are as follows:

For example, consider the following XAML: <Button AutomationProperties.Name="Pause"><Image Source="pause.png"/></Button>

This XAML is an example where a button does not have text content, only image content. The application author has specifically added a AutomationProperties.Name attached property value, so that the button has proper human-readable identification for accessibility scenarios such as being represented by a screen reader. In the basic ButtonAutomationPeer implementation, the first thing that the implementation chain does is to call base, which invokes the GetNameCore() method. In this case the GetNameCore() method finds that a value for AutomationProperties.Name exists in the attached property store for this Button instance, and therefore returns that value. The specific ButtonAutomationPeer implementation of GetNameCore is only invoked in the cases where the base returns null. Your own implementations of any *Core method that corresponds to a AutomationProperties attached property should follow this pattern: call base first to make sure that the FrameworkElementAutomationPeer base cannot obtain a runtime value based on instance-specific AutomationProperties values. Only if the base returns null should your *Core implementations attempt to provide a value, as determined either by general values for all class instances, or other instance-specific values that are available through the peer or its owner.

In some cases, a peer should implement a *Core method such that any automation information that exists in an object contained by the owner can be correctly forwarded by the owner's peer. This is the reason why certain "Item" peers such as ItemAutomationPeer override a larger range of *Core methods than a typical Silverlight automation peer does. Depending on your control implementation, it may be worthwhile to base the peer on ItemAutomationPeer to take advantage of that implementation. Otherwise, you can follow this basic pattern (code shown here is an implementation from ItemAutomationPeer).

protected override AutomationPeer GetLabeledByCore()
{
    if (base.Owner != null)
    { //this is the base call that makes sure AutomationProperties.LabeledBy
    // gets used if it is set on an instance
        return base.GetLabeledByCore();
    }
    AutomationPeer containerPeer = this.GetContainerPeer();
    if (containerPeer != null)
    { // this checks whether there is a container peer, and if so forwards
    //the call to that peer's version of the method
        return containerPeer.GetLabeledBy();
    }
    return null;
}

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
System.Object
  System.Windows.DependencyObject
    System.Windows.Automation.Peers.AutomationPeer
      System.Windows.Automation.Peers.FrameworkElementAutomationPeer
        System.Windows.Automation.Peers.AutoCompleteBoxAutomationPeer
        System.Windows.Automation.Peers.ButtonBaseAutomationPeer
        System.Windows.Automation.Peers.CalendarAutomationPeer
        System.Windows.Automation.Peers.CalendarButtonAutomationPeer
        System.Windows.Automation.Peers.CalendarDayButtonAutomationPeer
        System.Windows.Automation.Peers.ChildWindowAutomationPeer
        System.Windows.Automation.Peers.DataGridAutomationPeer
        System.Windows.Automation.Peers.DataGridCellAutomationPeer
        System.Windows.Automation.Peers.DataGridColumnHeaderAutomationPeer
        System.Windows.Automation.Peers.DataGridColumnHeadersPresenterAutomationPeer
        System.Windows.Automation.Peers.DataGridDetailsPresenterAutomationPeer
        System.Windows.Automation.Peers.DataGridGroupItemAutomationPeer
        System.Windows.Automation.Peers.DataGridItemAutomationPeer
        System.Windows.Automation.Peers.DataGridRowAutomationPeer
        System.Windows.Automation.Peers.DataGridRowGroupHeaderAutomationPeer
        System.Windows.Automation.Peers.DataGridRowHeaderAutomationPeer
        System.Windows.Automation.Peers.DataGridRowsPresenterAutomationPeer
        System.Windows.Automation.Peers.DataPagerAutomationPeer
        System.Windows.Automation.Peers.DatePickerAutomationPeer
        System.Windows.Automation.Peers.DescriptionViewerAutomationPeer
        System.Windows.Automation.Peers.FrameAutomationPeer
        System.Windows.Automation.Peers.GridSplitterAutomationPeer
        System.Windows.Automation.Peers.ImageAutomationPeer
        System.Windows.Automation.Peers.ItemAutomationPeer
        System.Windows.Automation.Peers.ItemsControlAutomationPeer
        System.Windows.Automation.Peers.LabelAutomationPeer
        System.Windows.Automation.Peers.MediaElementAutomationPeer
        System.Windows.Automation.Peers.MultiScaleImageAutomationPeer
        System.Windows.Automation.Peers.PasswordBoxAutomationPeer
        System.Windows.Automation.Peers.RangeBaseAutomationPeer
        System.Windows.Automation.Peers.RichTextBlockAutomationPeer
        System.Windows.Automation.Peers.RichTextBlockOverflowAutomationPeer
        System.Windows.Automation.Peers.RichTextBoxAutomationPeer
        System.Windows.Automation.Peers.ScrollViewerAutomationPeer
        System.Windows.Automation.Peers.TextBlockAutomationPeer
        System.Windows.Automation.Peers.TextBoxAutomationPeer
        System.Windows.Automation.Peers.ThumbAutomationPeer
        System.Windows.Automation.Peers.TreeViewAutomationPeer
        System.Windows.Automation.Peers.TreeViewItemAutomationPeer
        System.Windows.Automation.Peers.ValidationSummaryAutomationPeer
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.