Version

GetVisualChild<T> Method

Obtain specific child object of specific type T by examining the visual tree.
Syntax
'Declaration
 
Public Shared Function GetVisualChild(Of T As Class)( _
   ByVal parent As DependencyObject _
) As T
public static T GetVisualChild<T>( 
   DependencyObject parent
)
where T: class

Parameters

parent
The object that holds the child collection.

Type Parameters

T
The System.Type of desired child element.

Return Value

Child element of type T or null if not found.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also