[]
        
(Showing Draft Content)

C1.WPF.VTreeHelper.GetParentOfType

GetParentOfType Method

GetParentOfType(DependencyObject, Type)

Returns a 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 null.

Declaration
public static DependencyObject GetParentOfType(DependencyObject reference, Type type)
Parameters
Type Name Description
DependencyObject reference

The visual whose parent is returned.

Type type

The Type of the parent element to search for.

Returns
Type Description
DependencyObject

The parent of the visual.

GetParentOfType(DependencyObject, Type, DependencyObject)

Returns a 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.

Declaration
public static DependencyObject GetParentOfType(DependencyObject reference, Type type, DependencyObject endObject)
Parameters
Type Name Description
DependencyObject reference

The visual whose parent is returned.

Type type

The Type of the parent element to search for.

DependencyObject endObject

The visual representing the end point of search.

Returns
Type Description
DependencyObject

The parent of the visual.

GetParentOfType(DependencyObject, Type, bool)

Returns a 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 null.

Declaration
public static DependencyObject GetParentOfType(DependencyObject reference, Type type, bool lookOutsideVisualTree)
Parameters
Type Name Description
DependencyObject reference

The visual whose parent is returned.

Type type

The Type of the parent element to search for.

bool lookOutsideVisualTree

Specifies whether the search should go on outside the VisualTree.

Returns
Type Description
DependencyObject

The parent of the visual.

GetParentOfType(DependencyObject, Type, DependencyObject, bool)

Returns a 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.

Declaration
public static DependencyObject GetParentOfType(DependencyObject reference, Type type, DependencyObject endObject, bool lookOutsideVisualTree)
Parameters
Type Name Description
DependencyObject reference

The visual whose parent is returned.

Type type

The Type of the parent element to search for.

DependencyObject endObject

The visual representing the end point of search.

bool lookOutsideVisualTree

Specifies whether the search should go on outside the VisualTree.

Returns
Type Description
DependencyObject

The parent of the visual.