VisualTreeAssistGetParentsUntilCountTParentType, TEndType Method DW.WPFToolkit Documentation
Gets the amount of parent controls which are the given type as long no control with the second control type is found.

Namespace: DW.WPFToolkit.Helpers
Assembly: DW.WPFToolkit (in DW.WPFToolkit.dll) Version: 5.6.0.0
Syntax

C#
public static int GetParentsUntilCount<TParentType, TEndType>(
	DependencyObject item
)
where TParentType : DependencyObject
where TEndType : DependencyObject

Parameters

item
Type: System.WindowsDependencyObject
The child control where the search is start from. If this its null this method will return 0.

Type Parameters

TParentType
The type of the parent control to check for.
TEndType
The type of the parent control when to stop counting.

Return Value

Type: Int32
The amount of found parent controls with the specific type. 0 if nothing is found or the passed item is null.
See Also

Reference