Version

GetParent(DependencyObject) Method

Returns the parent of a child element.
Syntax
'Declaration
 
Public Overloads Shared Function GetParent( _
   ByVal child As DependencyObject _
) As DependencyObject
public static DependencyObject GetParent( 
   DependencyObject child
)

Parameters

child
The child element.

Return Value

The parent element.
Remarks

Note: if the child is derived from System.Windows.Media.Visual or System.Windows.Media.Media3D.Visual3D this method returns its parent parent. However, if the child is derived from System.Windows.FrameworkContentElement this method returns its logical parent.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, 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