ClassNotifyCollection<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
NotifyCollection()
Initializes a new instance of the NotifyCollection<T> class.
Declaration
public NotifyCollection()
NotifyCollection(IList<T>)
Initializes a new instance of the NotifyCollection<T> class with the specified list.
Declaration
public NotifyCollection(IList<T> list)
Parameters
list
IList<T>
The list to wrap as a NotifyCollection.
Fields
Empty
Declaration
public static NotifyCollection<T> Empty
Field Value
Properties
Methods
AddRange(IEnumerable<T>)
Adds multiple items to the collection in a batch operation.
Declaration
public void AddRange(IEnumerable<T> items)
Parameters
items
IEnumerable<T>
The enumerable collection of items to add.
Remarks
This method uses BeginUpdate/EndUpdate to perform a batch operation with a single notification.
AddRange(params T[])
Adds multiple items to the collection in a batch operation.
Declaration
public void AddRange(params T[] items)
Parameters
items
T[]
The items to add to the collection.
Remarks
This method uses BeginUpdate/EndUpdate to perform a batch operation with a single notification.
BeginUpdate()
Suspends change notifications until EndUpdate is called.
Declaration
public void BeginUpdate()
Remarks
Use this method to perform multiple operations without triggering notifications for each change. Always pair with EndUpdate to resume notifications.
ClearItems()
Declaration
protected override void ClearItems()
Overrides
CreateEventArguments(NotifyCollectionChangedAction)
Declaration
protected virtual NotifyCollectionChangedEventArgs CreateEventArguments(NotifyCollectionChangedAction action)
Parameters
action
Returns
CreateEventArguments(NotifyCollectionChangedAction, object, int)
Declaration
protected virtual NotifyCollectionChangedEventArgs CreateEventArguments(NotifyCollectionChangedAction action, object item, int index)
Parameters
action
item
index
Returns
CreateEventArguments(NotifyCollectionChangedAction, object, object, int)
Declaration
protected virtual NotifyCollectionChangedEventArgs CreateEventArguments(NotifyCollectionChangedAction action, object oldItem, object item, int index)
Parameters
action
oldItem
item
index
Returns
DeferRefresh()
Defers the refresh.
EndUpdate()
Resumes change notifications and fires any pending notifications.
Declaration
public void EndUpdate()
InsertItem(int, T)
Declaration
protected override void InsertItem(int index, T item)
Parameters
index
item
T
Overrides
Move(int, int)
Moves an item from one index to another.
OnCollectionChanged(NotifyCollectionChangedEventArgs)
Declaration
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs args)
Parameters
args
OnPropertyChanged(PropertyChangedEventArgs)
Declaration
protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)
Parameters
e
OnPropertyChanged(string)
Declaration
protected void OnPropertyChanged(string propertyName)
Parameters
propertyName
RemoveItem(int)
Declaration
protected override void RemoveItem(int index)
Parameters
index
Overrides
SetItem(int, T)
Declaration
protected override void SetItem(int index, T item)
Parameters
index
item
T
Overrides
Events
CollectionChanged
Occurs when the collection changes.
Declaration
public event NotifyCollectionChangedEventHandler CollectionChanged
Event Value
Implements
PropertyChanged
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Value
Implements