GetChildrenCount Method
Collapse the table of content
Expand the table of content

VisualTreeHelper.GetChildrenCount Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Returns the number of children that exists in an object's child collection in the visual tree.

Namespace:  System.Windows.Media
Assembly:  System.Windows (in System.Windows.dll)

public static int GetChildrenCount(
	DependencyObject reference
)

Parameters

reference
Type: System.Windows.DependencyObject
The source visual.

Return Value

Type: System.Int32
The number of visual children for the provided source visual.

ExceptionCondition
InvalidOperationException

reference is null, or is not a valid UIElement.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft