Visual.FindCommonVisualAncestor(DependencyObject) 方法

定义

返回两个可视对象的公共上级。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 类型的可视对象。A visual object of type DependencyObject.

返回

可视对象和 otherVisual 的公共上级(如果存在的话);否则为 nullThe common ancestor of the visual object and otherVisual if one exists; otherwise, null.

注解

二维和三维对象可以具有常见的视觉对象, 因此可以传递Visual3D的。 otherVisual2D and 3D objects can have common visual ancestors, so it is possible to pass a Visual3D for otherVisual.

适用于