VisualTreeHelper.GetChildrenCount Method (DependencyObject)
Returns the number of children that the specified visual object contains.
Assembly: PresentationCore (in PresentationCore.dll)
The following example shows how to enumerate all the descendants of a visual object. This is a technique you might use if you are interested in serializing all the rendering information of a visual object hierarchy or are performing analysis or alternative rendering.
Available since 3.0
Available since 2.0
Windows Phone Silverlight
Available since 7.0