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