Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

VisualCollection.Count Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets the number of elements in the collection.

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

public int Count { get; }

Property Value

Type: System.Int32

The number of elements that the VisualCollection contains.

Count is the number of elements that are actually in the VisualCollection. Capacity is the number of elements that the VisualCollection is capable of storing.

Count is always less than or equal to Capacity. If Count exceeds Capacity while adding elements, the capacity of the list is doubled by automatically reallocating the internal array before copying the old elements and adding the new elements.

.NET Framework
Available since 3.0
Return to top
Show:
© 2018 Microsoft