ComponentOne Basic Library for WPF and Silverlight
GetParentOfType(DependencyObject,Type,DependencyObject,Boolean) Method


C1.Silverlight Namespace > VTreeHelper Class > GetParentOfType Method : GetParentOfType(DependencyObject,Type,DependencyObject,Boolean) Method
The visual whose parent is returned.
The System.Type of the parent element to search for.
The visual representing the end point of search.
Specifies whether the search should go on outside the VisualTree.
Returns a System.Windows.DependencyObject value that represents the parent of the visual object of the specified type. Method looks up the visual tree until the desired parent element is found or parent element is equal to the specified endObject.
Syntax
'Declaration
 
Public Overloads Shared Function GetParentOfType( _
   ByVal reference As System.Windows.DependencyObject, _
   ByVal type As System.Type, _
   ByVal endObject As System.Windows.DependencyObject, _
   ByVal lookOutsideVisualTree As System.Boolean _
) As System.Windows.DependencyObject
'Usage
 
Dim reference As System.Windows.DependencyObject
Dim type As System.Type
Dim endObject As System.Windows.DependencyObject
Dim lookOutsideVisualTree As System.Boolean
Dim value As System.Windows.DependencyObject
 
value = VTreeHelper.GetParentOfType(reference, type, endObject, lookOutsideVisualTree)
public static System.Windows.DependencyObject GetParentOfType( 
   System.Windows.DependencyObject reference,
   System.Type type,
   System.Windows.DependencyObject endObject,
   System.bool lookOutsideVisualTree
)

Parameters

reference
The visual whose parent is returned.
type
The System.Type of the parent element to search for.
endObject
The visual representing the end point of search.
lookOutsideVisualTree
Specifies whether the search should go on outside the VisualTree.

Return Value

The parent of the visual.
See Also

Reference

VTreeHelper Class
VTreeHelper Members
Overload List