System.Collections.Specialized.INotifyCollectionChanged

Notifies listeners of dynamic changes, such as when items get added and removed or the whole list is refreshed.

See Also: INotifyCollectionChanged Members

Syntax

[System.Runtime.CompilerServices.TypeForwardedFrom("WindowsBase, Version=3.0.0.0, PublicKeyToken=31bf3856ad364e35")]
public interface INotifyCollectionChanged

Remarks

You can enumerate over any collection that implements the IEnumerable interface. However, to set up dynamic bindings so that insertions or deletions in the collection update the TLA2#tla_ui automatically, the collection must implement the System.Collections.Specialized.INotifyCollectionChanged interface. This interface exposes the INotifyCollectionChanged.CollectionChanged event that must be raised whenever the underlying collection changes.

TLA2#tla_winclient provides the System.Collections.ObjectModel.ObservableCollection`1 class, which is a built-in implementation of a data collection that exposes the System.Collections.Specialized.INotifyCollectionChanged interface. For an example, see Implement an Observable Collection.

The individual data objects within the collection must satisfy the requirements described in the Binding Sources Overview.

Before implementing your own collection, consider using System.Collections.ObjectModel.ObservableCollection`1 or one of the existing collection classes, such as List`1, System.Collections.ObjectModel.Collection`1, and System.ComponentModel.BindingList`1, among many others.

If you have an advanced scenario and want to implement your own collection, consider using IList, which provides a non-generic collection of objects that can be individually accessed by index and provides the best performance.

Requirements

Namespace: System.Collections.Specialized
Assembly: System (in System.dll)
Assembly Versions: 4.0.0.0