NotifyCollection<T>
Represents a collection that provides notifications when items are added, removed, or when the list is refreshed.
Definition
Namespace:Telerik.Collections.Generic
Assembly:Telerik.WinControls.dll
Type Parameters:
T
The type of elements in the collection.
Syntax:
public class NotifyCollection<T> : Collection<T>, IList, ICollection, IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged
Inheritance: objectCollection<T>NotifyCollection<T>
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a new instance of the NotifyCollection<T> class.
public NotifyCollection()
Initializes a new instance of the NotifyCollection<T> class with the specified list.
public NotifyCollection(IList<T> list)
The list to wrap as a NotifyCollection.
Fields
public static NotifyCollection<T> Empty
Properties
Methods
Adds multiple items to the collection in a batch operation.
public void AddRange(IEnumerable<T> items)
The enumerable collection of items to add.
This method uses BeginUpdate/EndUpdate to perform a batch operation with a single notification.
Adds multiple items to the collection in a batch operation.
public void AddRange(params T[] items)
The items to add to the collection.
This method uses BeginUpdate/EndUpdate to perform a batch operation with a single notification.
Suspends change notifications until EndUpdate is called.
public void BeginUpdate()
Use this method to perform multiple operations without triggering notifications for each change. Always pair with EndUpdate to resume notifications.
protected override void ClearItems()
Overrides:
protected virtual NotifyCollectionChangedEventArgs CreateEventArguments(NotifyCollectionChangedAction action, object item, int index)
protected virtual NotifyCollectionChangedEventArgs CreateEventArguments(NotifyCollectionChangedAction action, object oldItem, object item, int index)
protected virtual NotifyCollectionChangedEventArgs CreateEventArguments(NotifyCollectionChangedAction action)
Defers the refresh.
Resumes change notifications and fires any pending notifications.
public void EndUpdate()
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs args)
protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)
Events
Occurs when the collection changes.
public event NotifyCollectionChangedEventHandler CollectionChanged
Implements:
public event PropertyChangedEventHandler PropertyChanged
Implements: