ParentOfTypeExtensions.GetVisualParent(T) Method
Click or drag to resize
ParentOfTypeExtensionsGetVisualParentT Method
Searches up in the visual tree for parent element of the specified type.

Namespace: Telerik.Windows.Controls
Assembly: Telerik.Windows.Controls (in Telerik.Windows.Controls.dll) Version: 2018.2.620.40 (2018.2.620.40)
public static T GetVisualParent<T>(
	this DependencyObject element
where T : DependencyObject


Type: System.WindowsDependencyObject
The target DependencyObject which visual parents will be traversed.

Type Parameters

The type of the parent that will be searched up in the visual object hierarchy. The type should be DependencyObject.

Return Value

Type: T
Visual parent of the specified type if there is any, otherwise null.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DependencyObject. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also