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.

Namespace:  C1.Silverlight
Assembly:  C1.Silverlight (in C1.Silverlight.dll)

Syntax

C#
public static DependencyObject GetParentOfType(
	DependencyObject reference,
	Type type,
	DependencyObject endObject,
	bool lookOutsideVisualTree
)
Visual Basic
Public Shared Function GetParentOfType ( _
	reference As DependencyObject, _
	type As Type, _
	endObject As DependencyObject, _
	lookOutsideVisualTree As Boolean _
) As DependencyObject

Parameters

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

Return Value

The parent of the visual.

See Also