UIElement.OnCreateAutomationPeer UIElement.OnCreateAutomationPeer UIElement.OnCreateAutomationPeer UIElement.OnCreateAutomationPeer Method

定義

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. 如需如何執行此模式的詳細AutomationPeer資訊, 請參閱。For details on implementing this pattern, see AutomationPeer.

適用於