Condividi tramite


TextElement.OnCreateAutomationPeer Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Returns a class-specific AutomationPeer implementation for use by the Silverlight automation infrastructure.

Namespace:  System.Windows.Documents
Assembly:  System.Windows (in System.Windows.dll)

Syntax

'Declaration
Protected Overridable Function OnCreateAutomationPeer As AutomationPeer
protected virtual AutomationPeer OnCreateAutomationPeer()

Return Value

Type: System.Windows.Automation.Peers.AutomationPeer
A type-specific AutomationPeer for the TextElement object.

Remarks

Notes to Inheritors

The implementation of this method is typically to call the constructor of a specific AutomationPeer implementation, and return it as the return value.

All TextElement derived classes should implement this method in order to provide their own specific AutomationPeer implementations to the Silverlight infrastructure. For details on implementing this pattern, see AutomationPeer.

Version Information

Silverlight

Supported in: 5, 4

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

Platforms

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