ParentOfType<T> Method
Gets the parent element from the visual tree by given type.
Syntax
'Declaration <ExtensionAttribute()> Public Shared Function ParentOfType(Of T As DependencyObject)( _ ByVal element As DependencyObject _ ) As T
'Usage Dim element As DependencyObject Dim value As T value = DependencyObjectExtensions.ParentOfType(Of T)(element)
[Extension()] public static T ParentOfType<T>( DependencyObject element ) where T: DependencyObject
[Extension()] public: static T^ ParentOfTypegeneric<typename T> ( DependencyObject^ element ) where T: DependencyObject
Parameters
- element
- DependencyObject
Type Parameters
- T
- T is of DependencyObject
Return Value
parent of type DependencyObject
Requirements
Target Platforms: Windows 7, 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