Version

GetCommonAncestor Method

Static method that returns the deepest nested element that is a common ancestor element of both the passed in elements.
Syntax
'Declaration
 
Public Shared Function GetCommonAncestor( _
   ByVal element1 As UIElement, _
   ByVal element2 As UIElement _
) As UIElement
public static UIElement GetCommonAncestor( 
   UIElement element1,
   UIElement element2
)

Parameters

element1
The first UIElement to check.
element2
The second UIElement to check.

Return Value

The UIElement that is a common ancestor of both elements.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also