DependencyObjectExtensions.FindDescendantOrSelf Method

Definition

Overloads

FindDescendantOrSelf(DependencyObject, Type)

Find the first descendant (or self) element of a given type, using a depth-first search.

FindDescendantOrSelf(DependencyObject, String, StringComparison)

Find the first descendant (or self) of type Windows.UI.Xaml.FrameworkElement with a given name, using a depth-first search.

FindDescendantOrSelf<T,TState>(DependencyObject, TState, Func<T,TState,Boolean>)

Find the first descendant (or self) element matching a given predicate, using a depth-first search.

FindDescendantOrSelf<T>(DependencyObject)

Find the first descendant (or self) element of a given type, using a depth-first search.

FindDescendantOrSelf<T>(DependencyObject, Func<T,Boolean>)

Find the first descendant (or self) element matching a given predicate, using a depth-first search.

FindDescendantOrSelf(DependencyObject, Type)

Find the first descendant (or self) element of a given type, using a depth-first search.

public static Windows.UI.Xaml.DependencyObject? FindDescendantOrSelf (this Windows.UI.Xaml.DependencyObject element, Type type);
static member FindDescendantOrSelf : Windows.UI.Xaml.DependencyObject * Type -> Windows.UI.Xaml.DependencyObject
<Extension()>
Public Function FindDescendantOrSelf (element As DependencyObject, type As Type) As DependencyObject

Parameters

element
Windows.UI.Xaml.DependencyObject

The root element.

type
Type

The type of element to match.

Returns

Windows.UI.Xaml.DependencyObject

The descendant (or self) that was found, or null.

Applies to

FindDescendantOrSelf(DependencyObject, String, StringComparison)

Find the first descendant (or self) of type Windows.UI.Xaml.FrameworkElement with a given name, using a depth-first search.

public static Windows.UI.Xaml.FrameworkElement? FindDescendantOrSelf (this Windows.UI.Xaml.DependencyObject element, string name, StringComparison comparisonType = System.StringComparison.Ordinal);
static member FindDescendantOrSelf : Windows.UI.Xaml.DependencyObject * string * StringComparison -> Windows.UI.Xaml.FrameworkElement
<Extension()>
Public Function FindDescendantOrSelf (element As DependencyObject, name As String, Optional comparisonType As StringComparison = System.StringComparison.Ordinal) As FrameworkElement

Parameters

element
Windows.UI.Xaml.DependencyObject

The root element.

name
String

The name of the element to look for.

comparisonType
StringComparison

The comparison type to use to match name.

Returns

Windows.UI.Xaml.FrameworkElement

The descendant (or self) that was found, or null.

Applies to

FindDescendantOrSelf<T,TState>(DependencyObject, TState, Func<T,TState,Boolean>)

Find the first descendant (or self) element matching a given predicate, using a depth-first search.

public static T? FindDescendantOrSelf<T,TState> (this Windows.UI.Xaml.DependencyObject element, TState state, Func<T,TState,bool> predicate) where T : Windows.UI.Xaml.DependencyObject;
static member FindDescendantOrSelf : Windows.UI.Xaml.DependencyObject * 'State * Func<'T, 'State, bool (requires 'T :> Windows.UI.Xaml.DependencyObject)> -> 'T (requires 'T :> Windows.UI.Xaml.DependencyObject)
<Extension()>
Public Function FindDescendantOrSelf(Of T As DependencyObject, TState As DependencyObject) (element As DependencyObject, state As TState, predicate As Func(Of T, TState, Boolean)) As T

Type Parameters

T

The type of elements to match.

TState

The type of state to use when matching nodes.

Parameters

element
Windows.UI.Xaml.DependencyObject

The root element.

state
TState

The state to give as input to predicate.

predicate
Func<T,TState,Boolean>

The predicatee to use to match the descendant nodes.

Returns

T

The descendant (or self) that was found, or null.

Applies to

FindDescendantOrSelf<T>(DependencyObject)

Find the first descendant (or self) element of a given type, using a depth-first search.

public static T? FindDescendantOrSelf<T> (this Windows.UI.Xaml.DependencyObject element) where T : Windows.UI.Xaml.DependencyObject;
static member FindDescendantOrSelf : Windows.UI.Xaml.DependencyObject -> 'T (requires 'T :> Windows.UI.Xaml.DependencyObject)
<Extension()>
Public Function FindDescendantOrSelf(Of T As DependencyObject) (element As DependencyObject) As T

Type Parameters

T

The type of elements to match.

Parameters

element
Windows.UI.Xaml.DependencyObject

The root element.

Returns

T

The descendant (or self) that was found, or null.

Applies to

FindDescendantOrSelf<T>(DependencyObject, Func<T,Boolean>)

Find the first descendant (or self) element matching a given predicate, using a depth-first search.

public static T? FindDescendantOrSelf<T> (this Windows.UI.Xaml.DependencyObject element, Func<T,bool> predicate) where T : Windows.UI.Xaml.DependencyObject;
static member FindDescendantOrSelf : Windows.UI.Xaml.DependencyObject * Func<'T, bool (requires 'T :> Windows.UI.Xaml.DependencyObject)> -> 'T (requires 'T :> Windows.UI.Xaml.DependencyObject)
<Extension()>
Public Function FindDescendantOrSelf(Of T As DependencyObject) (element As DependencyObject, predicate As Func(Of T, Boolean)) As T

Type Parameters

T

The type of elements to match.

Parameters

element
Windows.UI.Xaml.DependencyObject

The root element.

predicate
Func<T,Boolean>

The predicatee to use to match the descendant nodes.

Returns

T

The descendant (or self) that was found, or null.

Applies to