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
)
You cannot use methods in XAML.

Parameters

current
Type: System.Windows.DependencyObject

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

Return Value

Type: System.Windows.DependencyObject
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 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0
Show: