KeyedCollection<TKey, TItem>.SetItem Method
Replaces the item at the specified index with the specified item.
Assembly: mscorlib (in mscorlib.dll)
The lookup dictionary is updated accordingly. That is, the key of the item that is being replaced is removed from the lookup dictionary, and the key of the new item is added.
This method overrides the protected Collection<T>.SetItem(Int32, T) method. The two methods are not overloads, as the overload list page states. In fact, they have exactly the same signature, because the base class of KeyedCollection<TKey, TItem> (KeyedCollection(Of TKey, TItem) in Visual Basic, generic<TKey, TItem> ref class KeyedCollection in C++) is Collection<TItem>, where the generic type parameter TItem of KeyedCollection<TKey, TItem> is substituted for the generic type parameter T of the Collection<T> generic class. The documentation build tools do not resolve these signatures correctly.
This method is an O(1) operation.
Notes for Implementers
This method does not affect the behavior of the KeyedCollection<TKey, TItem>.Item property, which is read-only.
Call the base class implementation of this method to set the item in the underlying collection and to update the lookup dictionary.
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.