UIElementAutomationPeer.CreatePeerForElement Method (UIElement)

 

Creates a UIElementAutomationPeer for the specified UIElement.

Namespace:   System.Windows.Automation.Peers
Assembly:  PresentationCore (in PresentationCore.dll)

Public Shared Function CreatePeerForElement (
	element As UIElement
) As AutomationPeer

Parameters

element
Type: System.Windows.UIElement

The UIElement that is associated with this UIElementAutomationPeer.

This UIElementAutomationPeer remains in memory until the associated UIElement is destroyed.

The same instance of the UIElementAutomationPeer is returned from subsequent calls to this method and calls to FromElement. The type of the peer is determined by the OnCreateAutomationPeer virtual callback. If UIElement does not implement the callback, no UIElementAutomationPeer is created, and this method returns null.

.NET Framework
Available since 3.0
Return to top
Show: