UIElementAutomationPeer.CreatePeerForElement Method (UIElement)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Creates a UIElementAutomationPeer for the specified UIElement.

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

public static AutomationPeer CreatePeerForElement(
	UIElement 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