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



Exception Condition

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.

.NET Framework
Available since 3.0
Return to top
© 2015 Microsoft