New to Telerik UI for WPFStart a free 30-day trial

Represents an ObservableCollection<T> that has ability to suspend change notification events.

Definition

Constructors

Initializes a new instance of the RadObservableCollection<T> class.

C#
public RadObservableCollection()

Initializes a new instance of the RadObservableCollection<T> class.

C#
public RadObservableCollection(IEnumerable<T> collection)
Parameters:collectionIEnumerable<T>

The collection from which the elements are copied.

Exceptions:

ArgumentNullException

The collection parameter cannot be null.

Properties

Gets the added items between suspend and resume.

C#
protected virtual IList<T> AddedItems { get; }
Property Value:

The added items.

Gets or sets a value indicating whether change to the collection is made when its notifications are suspended.

C#
protected bool IsDirty { get; set; }
Property Value:

true if this instance is has been changed while notifications are suspended; otherwise, false.

Gets a value indicating whether change notifications are suspended.

C#
public bool NotificationsSuspended { get; }
Property Value:

True if notifications are suspended, otherwise, false.

Implements: ISuspendNotifications.NotificationsSuspended

Gets the removed items between suspend and resume.

C#
protected virtual IList<T> RemovedItems { get; }
Property Value:

The removed items.

Get a value that indicates whether RadObservableCollection would raise CollectionChanged event with Reset action, when a bulk add/remove operation takes place.

C#
public bool ShouldResetOnResumeNotifications { get; }

Methods

Adds the elements of the specified collection to the end of the ObservableCollection<T>.

C#
public virtual void AddRange(IEnumerable<T> items)
Parameters:itemsIEnumerable<T>

The items that will be added.

Exceptions:

ArgumentNullException

items is null.

C#
protected override void ClearItems()

Overrides: ObservableCollection<T>.ClearItems()

C#
protected override void InsertItem(int index, T item)
Parameters:indexintitemT

Overrides: ObservableCollection<T>.InsertItem(int, T)

Inserts the elements of the specified collection at the specified index.

C#
public virtual void InsertRange(IEnumerable<T> items, int index)
Parameters:itemsIEnumerable<T>

The items that will be added.

indexint

The start index.

Exceptions:

ArgumentNullException

items is null.

C#
protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
Parameters:eNotifyCollectionChangedEventArgs

Overrides: ObservableCollection<T>.OnCollectionChanged(NotifyCollectionChangedEventArgs)

Remarks:

Raises the CollectionChanged event when notifications are not suspended.

Raises the event.

C#
protected virtual void OnCollectionChanging(CollectionChangingEventArgs e)
Parameters:eCollectionChangingEventArgs

The CollectionChangingEventArgs instance containing the event data.

C#
protected override void OnPropertyChanged(PropertyChangedEventArgs e)
Parameters:ePropertyChangedEventArgs

Overrides: ObservableCollection<T>.OnPropertyChanged(PropertyChangedEventArgs)

Remarks:

Raises the PropertyChanged event when notifications are not suspended.

Raises the CollectionChanged in accordance to the value of ShouldResetOnResumeNotifications and the presence of modified items.

C#
protected virtual void RaiseCollectionChangedOnResume()
C#
protected override void RemoveItem(int index)
Parameters:indexint

Overrides: ObservableCollection<T>.RemoveItem(int)

Removes the elements from the specified collection.

C#
public virtual void RemoveRange(IEnumerable<T> items)
Parameters:itemsIEnumerable<T>

The items that will be removed.

Exceptions:

ArgumentNullException

items is null.

Raises CollectionChanged with Reset changed action.

C#
public void Reset()

Resumes the notifications.

C#
public virtual void ResumeNotifications()

Implements: ISuspendNotifications.ResumeNotifications()

Suspends the notifications.

C#
public virtual void SuspendNotifications()

Implements: ISuspendNotifications.SuspendNotifications()

Events

Occurs when collection is changing.

C#
public event EventHandler<CollectionChangingEventArgs> CollectionChanging

Occurs when a property value changes.

C#
public event PropertyChangedEventHandler PropertyChanged