ContentElement.OnCreateAutomationPeer 方法

定义

针对 Windows Presentation Foundation (WPF) 基础结构返回特定于类的 AutomationPeer 实现。Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.

protected:
 virtual System::Windows::Automation::Peers::AutomationPeer ^ OnCreateAutomationPeer();
protected virtual System.Windows.Automation.Peers.AutomationPeer OnCreateAutomationPeer ();
abstract member OnCreateAutomationPeer : unit -> System.Windows.Automation.Peers.AutomationPeer
override this.OnCreateAutomationPeer : unit -> System.Windows.Automation.Peers.AutomationPeer
Protected Overridable Function OnCreateAutomationPeer () As AutomationPeer

返回

AutomationPeer

特定于类型的 AutomationPeer 实现。The type-specific AutomationPeer implementation.

注解

对继承者的说明Notes to inheritors

此方法的实现通常是调用特定实现的构造函数 AutomationPeer ,并将其作为返回值返回。The implementation of this method is typically to call the constructor of a specific AutomationPeer implementation, and return it as the return value.

所有 ContentElement 派生类都应该实现此方法,以便为 WPF 基础结构提供自己的特定 AutomationPeer 实现。All ContentElement derived classes should implement this method in order to provide their own specific AutomationPeer implementations to the WPF infrastructure. 有关实现此模式的详细信息,请参阅 AutomationPeerFor details on implementing this pattern, see AutomationPeer.

适用于