UIElement.GetUIParentCore 方法

定義

當在衍生類別中覆寫時,如果沒有視覺化父項目存在,則會為這個項目傳回替代的使用者介面 (UI)user interface (UI) 父項目。When overridden in a derived class, returns an alternative 使用者介面 (UI)user interface (UI) parent for this element if no visual parent exists.

protected public:
 virtual System::Windows::DependencyObject ^ GetUIParentCore();
protected internal virtual System.Windows.DependencyObject GetUIParentCore ();
abstract member GetUIParentCore : unit -> System.Windows.DependencyObject
override this.GetUIParentCore : unit -> System.Windows.DependencyObject
Protected Friend Overridable Function GetUIParentCore () As DependencyObject

傳回

一個物件,如果衍生類別的實作有替代父代連接要報告。An object, if implementation of a derived class has an alternate parent connection to report.

備註

這個方法的預設虛擬實值會傳回 nullThe default virtual implementation of this method returns null. FrameworkElement 提供實際的執行方式。FrameworkElement provides a practical implementation.

替代父系用於事件路由,在專案建立替代的父結構時,讓其事件的路由方式是以分歧自將視覺化樹狀結構向上路由至標準父系的標準模式,或在預覽路由策略。Alternative parents are used for event routing, in cases where an element creates an alternative parent structure so that its events are routed in a way that diverges from the standard pattern of routing up the visual tree to the standard parent, or downward in the preview routing strategy.

適用於