ClassRadObservableCollection<T>
Represents an ObservableCollection<T> that has ability to suspend change notification events.
Definition
Namespace:Telerik.Windows.Data
Assembly:Telerik.Windows.Data.dll
Type Parameters:
T
The type of the items in the collection.
Syntax:
public class RadObservableCollection<T> : ObservableCollection<T>, IList<T>, ICollection<T>, IList, ICollection, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged, ISuspendNotifications
Inheritance: objectCollection<T>ObservableCollection<T>RadObservableCollection<T>
Derived Classes:
Implements:
Inherited Members
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
collection
IEnumerable<T>
The collection from which the elements are copied.
Exceptions
The collection parameter cannot be null.
Properties
AddedItems
Gets the added items between suspend and resume.
Declaration
protected virtual IList<T> AddedItems { get; }
Property Value
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
true if this instance is has been changed while notifications are
suspended; otherwise, false.
NotificationsSuspended
Gets a value indicating whether change notifications are suspended.
Declaration
public bool NotificationsSuspended { get; }
Property Value
True if notifications are suspended, otherwise, false.
Implements
RemovedItems
Gets the removed items between suspend and resume.
Declaration
protected virtual IList<T> RemovedItems { get; }
Property Value
IList<T>
The removed items.
ShouldResetOnResumeNotifications
Get a value that indicates whether RadObservableCollection would raise CollectionChanged event with Reset action, when a bulk add/remove operation takes place.
Declaration
public bool ShouldResetOnResumeNotifications { get; }
Property Value
Methods
AddRange(IEnumerable<T>)
Adds the elements of the specified collection to the end of the ObservableCollection<T>.
Declaration
public virtual void AddRange(IEnumerable<T> items)
Parameters
items
IEnumerable<T>
The items that will be added.
Exceptions
items is null.
ClearItems()
Declaration
protected override void ClearItems()
Overrides
InsertItem(int, T)
Declaration
protected override void InsertItem(int index, T item)
Parameters
index
item
T
Overrides
InsertRange(IEnumerable<T>, int)
Inserts the elements of the specified collection at the specified index.
Declaration
public virtual void InsertRange(IEnumerable<T> items, int index)
Parameters
items
IEnumerable<T>
The items that will be added.
index
The start index.
Exceptions
items is null.
OnCollectionChanged(NotifyCollectionChangedEventArgs)
Declaration
protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
Parameters
e
Overrides
Remarks
Raises the CollectionChanged event when notifications are not suspended.
OnCollectionChanging(CollectionChangingEventArgs)
Raises the event.
Declaration
protected virtual void OnCollectionChanging(CollectionChangingEventArgs e)
Parameters
e
The CollectionChangingEventArgs instance containing the event data.
OnPropertyChanged(PropertyChangedEventArgs)
Declaration
protected override void OnPropertyChanged(PropertyChangedEventArgs e)
Parameters
e
Overrides
Remarks
Raises the 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
[SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")]
protected virtual void RaiseCollectionChangedOnResume()
RemoveItem(int)
Declaration
protected override void RemoveItem(int index)
Parameters
index
Overrides
RemoveRange(IEnumerable<T>)
Removes the elements from the specified collection.
Declaration
public virtual void RemoveRange(IEnumerable<T> items)
Parameters
items
IEnumerable<T>
The items that will be removed.
Exceptions
items is null.
Reset()
Raises CollectionChanged with 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 Value
PropertyChanged
Occurs when a property value changes.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Value