Clear Method

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()

Exception Condition
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
Available since 3.0
Return to top
Show:
© 2016 Microsoft