Compartir a través de


ExtensionMethods.FindDescendantReverse<T>(DependencyObject) Method

Definition

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

USE SPARINGLY.

This method walks all the tree in reverse order 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 FindDescendantReverse(System::Windows::DependencyObject ^ obj);
public static T FindDescendantReverse<T> (this System.Windows.DependencyObject obj) where T : class;
static member FindDescendantReverse : System.Windows.DependencyObject -> 'T (requires 'T : null)
<Extension()>
Public Function FindDescendantReverse(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 last descendant of type T in the children of obj, or null if no descendant is found.

Applies to