This documentation is archived and is not being maintained.

LogicalTreeHelper.GetParent Method

Returns the logical parent element of the specified element.

Namespace: System.Windows
Assembly: PresentationFramework (in presentationframework.dll)

public static DependencyObject GetParent (
	DependencyObject current
public static DependencyObject GetParent (
	DependencyObject current
public static function GetParent (
	current : DependencyObject
) : DependencyObject
You cannot use methods in XAML.



The element to find the parent for. This is expected to be either FrameworkElement or FrameworkContentElement.

Return Value

The requested parent element.

This method is merely a wrapper that gets the appropriate type version (FrameworkElement or FrameworkContentElement) of the FrameworkElement.Parent or FrameworkContentElement.Parent property; so unless you are unable to determine the current type, check the respective instance properties instead.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0