Contains extension methods for enumerating the parents of an element.
Definition
Namespace:Telerik.Windows.Controls
Assembly:Telerik.Windows.Controls.dll
Syntax:
C#
public static class ParentOfTypeExtensions
Inheritance: objectParentOfTypeExtensions
Methods
GetParents(DependencyObject)
IEnumerable<DependencyObject>
Enumerates through element's parents in the visual tree.
C#
public static IEnumerable<DependencyObject> GetParents(this DependencyObject element)
IEnumerable<DependencyObject>
Searches up in the visual tree for parent element of the specified type.
C#
public static T GetVisualParent<T>(this DependencyObject element) where T : DependencyObject
The target DependencyObject which visual parents will be traversed.
Returns:T
Visual parent of the specified type if there is any, otherwise null.
Determines whether the element is an ancestor of the descendant.
C#
public static bool IsAncestorOf(this DependencyObject element, DependencyObject descendant)
true if the visual object is an ancestor of descendant; otherwise, false.
Gets the parent element from the visual tree by given type.
C#
public static T ParentOfType<T>(this DependencyObject element) where T : DependencyObject
T