Visual.FindCommonVisualAncestor(DependencyObject) 方法

定義

傳回兩個視覺物件的共同祖系。

C#
public System.Windows.DependencyObject FindCommonVisualAncestor(System.Windows.DependencyObject otherVisual);

參數

otherVisual
DependencyObject

型別 DependencyObject 的視覺物件。

傳回

如果存在一個視覺物件和 otherVisual 則為其共同祖系,否則為 null

備註

2D 和 3D 物件可以有常見的視覺上階,因此可以傳遞 Visual3DotherVisual

適用於

產品 版本
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10