UIElement.OnCreateAutomationPeer 方法

定义

Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 基础结构返回特定于类的 AutomationPeer 实现。Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation (WPF)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 实现。The type-specific AutomationPeer implementation.

继承者说明

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

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

适用于