ContentElementAutomationPeer.CreatePeerForElement Method (ContentElement)


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

Creates a ContentElementAutomationPeer for the specified ContentElement.

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

public static AutomationPeer CreatePeerForElement(
	ContentElement element


Type: System.Windows.ContentElement

The ContentElement that is associated with this ContentElementAutomationPeer.

This ContentElementAutomationPeer remains in memory until the associated ContentElement is destroyed.

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

.NET Framework
Available since 3.0
Return to top