Export (0) Print
Expand All

ItemCollection::Clear Method

Clears the collection and releases the references on all items currently in the collection.

Namespace:  System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public:
virtual void Clear() sealed

Implements

IList::Clear()

ExceptionCondition
InvalidOperationException

The ItemCollection is in ItemsSource mode. (When the ItemsSource property is set, the Items collection will be made read-only and fixed-size.)

The following example shows how to use this method. In the example, sbar is a StatusBar control, which is an ItemsControl.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft