Visual.FindCommonVisualAncestor(DependencyObject) Visual.FindCommonVisualAncestor(DependencyObject) Visual.FindCommonVisualAncestor(DependencyObject) Visual.FindCommonVisualAncestor(DependencyObject) Method

定義

傳回兩個視覺物件的共同祖系。Returns the common ancestor of two visual objects.

public:
 System::Windows::DependencyObject ^ FindCommonVisualAncestor(System::Windows::DependencyObject ^ otherVisual);
public System.Windows.DependencyObject FindCommonVisualAncestor (System.Windows.DependencyObject otherVisual);
member this.FindCommonVisualAncestor : System.Windows.DependencyObject -> System.Windows.DependencyObject
Public Function FindCommonVisualAncestor (otherVisual As DependencyObject) As DependencyObject

參數

otherVisual
DependencyObject DependencyObject DependencyObject DependencyObject

型別 DependencyObject 的視覺物件。A visual object of type DependencyObject.

傳回

如果存在一個視覺物件和 otherVisual 則為其共同祖系,否則為 nullThe common ancestor of the visual object and otherVisual if one exists; otherwise, null.

備註

2D 和 3D 物件可以有通用的 visual 上階,因此可以傳遞Visual3D針對otherVisual2D and 3D objects can have common visual ancestors, so it is possible to pass a Visual3D for otherVisual.

適用於