Class RadObservableCollection<T>
Represents an System.Collections.ObjectModel.ObservableCollection<> that has ability to suspend change notification events.
Inheritance
Namespace: Telerik.Windows.Data
Assembly: Telerik.Windows.Data.dll
Syntax
public class RadObservableCollection<T> : ObservableCollection<T>, ISuspendNotifications, INotifyCollectionStateProvider
Type Parameters
T
The type of the items in the collection. |
Constructors
RadObservableCollection()
Initializes a new instance of the RadObservableCollection<T> class.
Declaration
public RadObservableCollection()
RadObservableCollection(IEnumerable<T>)
Initializes a new instance of the RadObservableCollection<T> class.
Declaration
public RadObservableCollection(IEnumerable<T> collection)
Parameters
System.Collections.Generic.IEnumerable<T>
collection
The collection from which the elements are copied. |
Exceptions
System.ArgumentNullException
The |
Properties
AddedItems
Gets the added items between suspend and resume.
Declaration
protected virtual IList<T> AddedItems { get; }
Property Value
System.Collections.Generic.IList<T>
The added items. |
IsDirty
Gets or sets a value indicating whether change to the collection is made when its notifications are suspended.
Declaration
protected bool IsDirty { get; set; }
Property Value
System.Boolean
|
NotificationsSuspended
Gets a value indicating whether change notifications are suspended.
Declaration
public bool NotificationsSuspended { get; }
Property Value
System.Boolean
|
Implements
RemovedItems
Gets the removed items between suspend and resume.
Declaration
protected virtual IList<T> RemovedItems { get; }
Property Value
System.Collections.Generic.IList<T>
The removed items. |
Methods
AddRange(IEnumerable<T>)
Adds the elements of the specified collection to the end of the System.Collections.ObjectModel.ObservableCollection<>.
Declaration
public virtual void AddRange(IEnumerable<T> items)
Parameters
System.Collections.Generic.IEnumerable<T>
items
The items that will be added. |
Exceptions
System.ArgumentNullException
|
ClearItems()
Declaration
protected override void ClearItems()
InsertItem(Int32, T)
Declaration
protected override void InsertItem(int index, T item)
Parameters
System.Int32
index
|
T
item
|
InsertRange(IEnumerable<T>, Int32)
Inserts the elements of the specified collection at the specified index.
Declaration
public virtual void InsertRange(IEnumerable<T> items, int index)
Parameters
System.Collections.Generic.IEnumerable<T>
items
The items that will be added. |
System.Int32
index
The start index. |
Exceptions
System.ArgumentNullException
|
Move(Int32, Int32)
Moves the item located at the specified old index to the specified new index.
Declaration
public void Move(int oldIndex, int newIndex)
Parameters
System.Int32
oldIndex
The index at which the item to move is located. |
System.Int32
newIndex
The index to which the item at the old index is moved. |
MoveItem(Int32, Int32)
Moves the item located at the specified old index to the specified new index.
Declaration
protected virtual void MoveItem(int oldIndex, int newIndex)
Parameters
System.Int32
oldIndex
The index at which the item to move is located. |
System.Int32
newIndex
The index to which the item at the old index is moved. |
OnCollectionChanged(NotifyCollectionChangedEventArgs)
Declaration
protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
Parameters
System.Collections.Specialized.NotifyCollectionChangedEventArgs
e
|
Remarks
Raises the System.Collections.Specialized.INotifyCollectionChanged.CollectionChanged event when notifications are not suspended.
OnCollectionChanging(CollectionChangingEventArgs)
Raises the CollectionChanging event.
Declaration
protected virtual void OnCollectionChanging(CollectionChangingEventArgs e)
Parameters
CollectionChangingEventArgs
e
The CollectionChangingEventArgs instance containing the event data. |
OnPropertyChanged(PropertyChangedEventArgs)
Declaration
protected override void OnPropertyChanged(PropertyChangedEventArgs e)
Parameters
System.ComponentModel.PropertyChangedEventArgs
e
|
Remarks
Raises the System.ComponentModel.INotifyPropertyChanged.PropertyChanged event when notifications are not suspended.
RaiseCollectionChangedOnResume()
Raises the CollectionChanged in accordance to the value of ShouldResetOnResumeNotifications and the presence of modified items.
Declaration
protected virtual void RaiseCollectionChangedOnResume()
RemoveItem(Int32)
Declaration
protected override void RemoveItem(int index)
Parameters
System.Int32
index
|
RemoveRange(IEnumerable<T>)
Removes the elements from the specified collection.
Declaration
public virtual void RemoveRange(IEnumerable<T> items)
Parameters
System.Collections.Generic.IEnumerable<T>
items
The items that will be removed. |
Exceptions
System.ArgumentNullException
|
Reset()
Raises System.Collections.Specialized.INotifyCollectionChanged.CollectionChanged with System.Collections.Specialized.NotifyCollectionChangedAction.Reset changed action.
Declaration
public void Reset()
ResumeNotifications()
Resumes the notifications.
Declaration
public virtual void ResumeNotifications()
Implements
SuspendNotifications()
Suspends the notifications.
Declaration
public virtual void SuspendNotifications()
Implements
Events
CollectionChanging
Occurs when collection is changing.
Declaration
public event EventHandler<CollectionChangingEventArgs> CollectionChanging
Event Type
System.EventHandler<CollectionChangingEventArgs>
|
PropertyChanged
Occurs when a property value changes.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
System.ComponentModel.PropertyChangedEventHandler
|