VisualCollection.Capacity 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 or sets the number of elements that the VisualCollection can contain.

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

public int Capacity { get; set; }

Property Value

Type: System.Int32

The number of elements that the VisualCollection can contain.

Exception Condition
ArgumentOutOfRangeException

Capacity is set to a value that is less than Count.

The value of Capacity is the number of elements that the VisualCollection is capable of storing. Count is the number of visuals that are actually in the VisualCollection. Capacity is always greater than or equal to Count. If Count exceeds Capacity while adding elements, the capacity of the VisualCollection is increased. By default Capacity is zero.

.NET Framework
Available since 3.0
Return to top
Show: