Share via


ExtensionMethods.FindDescendant Method

Definition

Overloads

FindDescendant(DependencyObject, Predicate<DependencyObject>)

Helper method that finds the first descendant satisfying predicate.

USE SPARINGLY.

This method walks all the tree until a result is found. Use of this method on large trees or excessively will introduce a performance hit.

FindDescendant<T>(DependencyObject, Predicate<T>)

Helper method that finds the first descendant of type T the visual tree that matches predicate.

USE SPARINGLY.

This method walks all the tree until a result is found. Use of this method on large trees or excessively will introduce a performance hit.

FindDescendant<T>(DependencyObject)

Helper method that finds the first descendant of a given Type in the visual tree.

USE SPARINGLY.

This method walks all the tree until a result is found. Use of this method on large trees or excessively will introduce a performance hit.

FindDescendant(DependencyObject, Predicate<DependencyObject>)

Helper method that finds the first descendant satisfying predicate.

USE SPARINGLY.

This method walks all the tree until a result is found. Use of this method on large trees or excessively will introduce a performance hit.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Windows::DependencyObject ^ FindDescendant(System::Windows::DependencyObject ^ obj, Predicate<System::Windows::DependencyObject ^> ^ predicate);
public static System.Windows.DependencyObject FindDescendant (this System.Windows.DependencyObject obj, Predicate<System.Windows.DependencyObject> predicate);
static member FindDescendant : System.Windows.DependencyObject * Predicate<System.Windows.DependencyObject> -> System.Windows.DependencyObject
<Extension()>
Public Function FindDescendant (obj As DependencyObject, predicate As Predicate(Of DependencyObject)) As DependencyObject

Parameters

obj
DependencyObject

The object at which to begin searching.

predicate
Predicate<DependencyObject>

The predicate which selects the descendant object

Returns

The first descendant that satisfies the predicate, or null if no descendant is found.

Applies to

FindDescendant<T>(DependencyObject, Predicate<T>)

Helper method that finds the first descendant of type T the visual tree that matches predicate.

USE SPARINGLY.

This method walks all the tree until a result is found. Use of this method on large trees or excessively will introduce a performance hit.

public:
generic <typename T>
 where T : class[System::Runtime::CompilerServices::Extension]
 static T FindDescendant(System::Windows::DependencyObject ^ obj, Predicate<T> ^ predicate);
public static T FindDescendant<T> (this System.Windows.DependencyObject obj, Predicate<T> predicate) where T : class;
static member FindDescendant : System.Windows.DependencyObject * Predicate<'T (requires 'T : null)> -> 'T (requires 'T : null)
<Extension()>
Public Function FindDescendant(Of T As Class) (obj As DependencyObject, predicate As Predicate(Of T)) As T

Type Parameters

T

The type of descendant to find.

Parameters

obj
DependencyObject

The object at which to begin searching.

predicate
Predicate<T>

The predicate which selects the descendant object

Returns

T

The first descendant of type T that satisfies the predicate, or null if no descendant is found.

Applies to

FindDescendant<T>(DependencyObject)

Helper method that finds the first descendant of a given Type in the visual tree.

USE SPARINGLY.

This method walks all the tree until a result is found. Use of this method on large trees or excessively will introduce a performance hit.

public:
generic <typename T>
 where T : class[System::Runtime::CompilerServices::Extension]
 static T FindDescendant(System::Windows::DependencyObject ^ obj);
public static T FindDescendant<T> (this System.Windows.DependencyObject obj) where T : class;
static member FindDescendant : System.Windows.DependencyObject -> 'T (requires 'T : null)
<Extension()>
Public Function FindDescendant(Of T As Class) (obj As DependencyObject) As T

Type Parameters

T

The type of descendant to find.

Parameters

obj
DependencyObject

The object at which to begin searching.

Returns

T

The first descendant of type T in the children of obj, or null if no descendant is found.

Applies to