ExtensionMethods.FindAncestorOrSelf ExtensionMethods.FindAncestorOrSelf ExtensionMethods.FindAncestorOrSelf Method

Definition

Overloads

FindAncestorOrSelf<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>) FindAncestorOrSelf<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>) FindAncestorOrSelf<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>)
FindAncestorOrSelf<TAncestorType>(Visual) FindAncestorOrSelf<TAncestorType>(Visual) FindAncestorOrSelf<TAncestorType>(Visual)

Finds the first ancestor of a given type in the logical or visual tree, or the object itself if it matches in type.

FindAncestorOrSelf<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>) FindAncestorOrSelf<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>) FindAncestorOrSelf<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>)

FindAncestorOrSelf<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>) FindAncestorOrSelf<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>) FindAncestorOrSelf<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>)

public static TAncestorType FindAncestorOrSelf<TAncestorType,TElementType> (this TElementType obj, Func<TElementType,TElementType> parentEvaluator) where TAncestorType : System.Windows.DependencyObject;
static member FindAncestorOrSelf : 'ElementType * Func<'ElementType, 'ElementType> -> 'AncestorType (requires 'AncestorType :> System.Windows.DependencyObject)
<Extension()>
Public Function FindAncestorOrSelf(Of TAncestorType As DependencyObject, TElementType As DependencyObject) (obj As TElementType, parentEvaluator As Func(Of TElementType, TElementType)) As TAncestorType
Type Parameters
TAncestorType
TElementType
Parameters
obj
parentEvaluator
Func<TElementType,TElementType>
Returns

FindAncestorOrSelf<TAncestorType>(Visual) FindAncestorOrSelf<TAncestorType>(Visual) FindAncestorOrSelf<TAncestorType>(Visual)

Finds the first ancestor of a given type in the logical or visual tree, or the object itself if it matches in type.

public static TAncestorType FindAncestorOrSelf<TAncestorType> (this System.Windows.Media.Visual obj) where TAncestorType : System.Windows.DependencyObject;
static member FindAncestorOrSelf : System.Windows.Media.Visual -> 'AncestorType (requires 'AncestorType :> System.Windows.DependencyObject)
<Extension()>
Public Function FindAncestorOrSelf(Of TAncestorType As DependencyObject) (obj As Visual) As TAncestorType
Type Parameters
TAncestorType

The type of ancestor to find.

Parameters
obj
Visual Visual Visual

The object at which to begin searching.

Returns

The object itself, if it matches in type, else the first ancestor of type T in the parent chain of obj, or null if no ancestor is found.

FindAncestorOrSelf<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>) FindAncestorOrSelf<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>) FindAncestorOrSelf<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>)

public static object FindAncestorOrSelf<TElementType> (this TElementType obj, Func<TElementType,TElementType> parentEvaluator, Func<TElementType,bool> ancestorSelector);
static member FindAncestorOrSelf : 'ElementType * Func<'ElementType, 'ElementType> * Func<'ElementType, bool> -> obj
<Extension()>
Public Function FindAncestorOrSelf(Of TElementType) (obj As TElementType, parentEvaluator As Func(Of TElementType, TElementType), ancestorSelector As Func(Of TElementType, Boolean)) As Object
Type Parameters
TElementType
Parameters
obj
parentEvaluator
Func<TElementType,TElementType>
ancestorSelector
Func<TElementType,Boolean>
Returns

Applies to