Observes property changes on its items and exposes item-level notifications in addition to collection changes.
Definition
Namespace:Telerik.WinForms.Documents.Utils
Assembly:Telerik.WinControls.RichTextEditor.dll
Type Parameters:
T
A reference type that implements INotifyPropertyChanged.
Syntax:
public class NotifiableCollection<T> : ObservableCollection<T>, IList, ICollection, IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged where T : class, INotifyPropertyChanged
Inheritance: objectCollection<T>ObservableCollection<T>NotifiableCollection<T>
Implements:
Inherited Members
Constructors
Initializes an empty collection that observes items added to it.
public NotifiableCollection()
Initializes the collection with the specified items and observes their property changes.
public NotifiableCollection(IEnumerable<T> items)
The items to add; must not be null.
Exceptions: ArgumentNullExceptionitems is null.
Methods
Detaches item-property handlers before clearing the collection.
protected override void ClearItems()
Overrides:
Call the base implementation to preserve handler cleanup and the observable collection's clear notification.
Inserts an item, raises ItemAdded, and observes the item's property changes.
protected override void InsertItem(int index, T item)
The zero-based insertion index.
itemTThe item to insert.
Overrides:
Call the base implementation to preserve item-change subscription and notification behavior.
Detaches the removed item's property-change handler before removing it.
protected override void RemoveItem(int index)
The zero-based index of the item to remove.
Overrides:
Call the base implementation to preserve handler cleanup and the observable collection's remove notification.
Replaces an item, raises ItemAdded for its index, and observes the replacement's property changes.
protected override void SetItem(int index, T item)
The zero-based index of the item to replace.
itemTThe replacement item.
Overrides:
Call the base implementation to preserve item-change subscription and notification behavior.
Events
Occurs after an item is inserted or replaces an existing item.
public event EventHandler<NotifyCollectionItemAddedEventArgs> ItemAdded
Occurs when an item raises PropertyChanged; the collection also raises a reset notification.
public event EventHandler<NotifyCollectionChangeEventArgs> ItemChanged