Esta documentación está archivada y no tiene mantenimiento.

INotifyCollectionChanged (Interfaz)

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

Espacio de nombres: System.Collections.Specialized
Ensamblado: WindowsBase (en windowsbase.dll)

public interface INotifyCollectionChanged
public interface INotifyCollectionChanged
public interface INotifyCollectionChanged
En XAML no se pueden utilizar interfaces directamente; vea los tipos que implementan esta interfaz.

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 UI automatically, the collection must implement the INotifyCollectionChanged interface. This interface exposes the CollectionChanged event that must be raised whenever the underlying collection changes.

WPF provides the ObservableCollection class, which is a built-in implementation of a data collection that exposes the 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 ObservableCollection or one of the existing collection classes, such as List, Collection, and BindingList, 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.

Microsoft .NET Framework 3.0 es compatible con Windows Vista, Microsoft Windows XP SP2 y Windows Server 2003 SP1.

.NET Framework

Compatible con: 3.0