ClearItems Method
Collapse the table of content
Expand the table of content

KeyedCollection(Of TKey, TItem).ClearItems Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Removes all elements from the KeyedCollection(Of TKey, TItem).

Namespace:  System.Collections.ObjectModel
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
Protected Overrides Sub ClearItems

If there is a lookup dictionary, this method clears it but does not delete it.

If the number of elements has exceeded the dictionary creation threshold and the KeyedCollection(Of TKey, TItem) is using a lookup dictionary, it will continue to use a lookup dictionary even though the number of elements is again under the threshold.

This method is an O(n) operation, where n is Count.

Notes for Implementers

Override this method to provide customized behavior for the Clear method, inherited from the Collection(Of T) generic class.

Call the base class implementation of this method to clear the underlying collection and to clear the lookup dictionary.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft