VisualTreeAssistGetParentCountTParentType Method DW.WPFToolkit Documentation
Gets the amount of parent controls which are the given type.

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

C#
public static int GetParentCount<TParentType>(
	DependencyObject item
)
where TParentType : 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.

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