CVB.Net 14.0
VisualTreeHelperExtensions Class Reference

Extends the VisualTreeHelper class. More...

Static Public Member Functions

static IEnumerable< T > FindChildren< T > (DependencyObject parent, string childName)
 Find all visual children with matching type and element name. More...
 
static IEnumerable< T > FindChildren< T > (DependencyObject parent)
 Find all visual children with matching type. More...
 
static T FindVisualParent< T > (this DependencyObject obj)
 Finds a parent of a certain type of a this item in the visual tree. More...
 

Detailed Description

Extends the VisualTreeHelper class.

Member Function Documentation

◆ FindChildren< T >() [1/2]

static IEnumerable< T > FindChildren< T > ( DependencyObject  parent)
static

Find all visual children with matching type.

Template Parameters
TType to look for.
Parameters
parentNode at which to start.
Returns
Collection of matching visual tree child nodes.
Type Constraints
T :DependencyObject 

◆ FindChildren< T >() [2/2]

static IEnumerable< T > FindChildren< T > ( DependencyObject  parent,
string  childName 
)
static

Find all visual children with matching type and element name.

Template Parameters
TType to look for.
Parameters
parentNode at which to start.
childNameElement name to look for.
Returns
Collection of matching visual tree child nodes.
Type Constraints
T :DependencyObject 

◆ FindVisualParent< T >()

static T FindVisualParent< T > ( this DependencyObject  obj)
static

Finds a parent of a certain type of a this item in the visual tree.

Template Parameters
TThe type of the queried item.
Parameters
objA direct or indirect obj of the queried item.
Returns
The first parent item that matches the submitted type parameter. If no matching item can be found, a null reference is being returned.
Type Constraints
T :DependencyObject