Class ObservableCollectionExtended<T>
- Namespace
- Dynamic
Data .Binding
- Assembly
- DynamicData.dll
An override of observable collection which allows the suspension of notifications.
public class ObservableCollectionExtended<T> : ObservableCollection<T>, IList, ICollection, IReadOnlyList<T>, IReadOnlyCollection<T>, IObservableCollection<T>, INotifyCollectionChanged, INotifyPropertyChanged, INotifyCollectionChangedSuspender, IExtendedList<T>, IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable
Type Parameters
TThe type of the item.
- Inheritance
-
Collection<T>ObservableCollectionExtended<T>
- Implements
-
IList<T>ICollection<T>IEnumerable<T>
- Inherited Members
- Extension Methods
Constructors
ObservableCollectionExtended()
Initializes a new instance of the ObservableCollectionExtended<T> class.
ObservableCollectionExtended(IEnumerable<T>)
Initializes a new instance of the ObservableCollectionExtended<T> class that contains elements copied from the specified collection.
Parameters
collectionIEnumerable<T>The collection from which the elements are copied.
Exceptions
- Argument
Null Exception The
collectionparameter cannot be null.
ObservableCollectionExtended(List<T>)
Initializes a new instance of the ObservableCollectionExtended<T> class that contains elements copied from the specified list.
Parameters
listList<T>The list from which the elements are copied.
Exceptions
- Argument
Null Exception The
listparameter cannot be null.
Methods
AddRange(IEnumerable<T>)
Adds the elements of the specified collection to the end of the collection.
Parameters
collectionIEnumerable<T>The collection whose elements should be added to the end of the List. The collection itself cannot be null, but it can contain elements that are null.
Exceptions
- Argument
Null Exception collectionis null.
InsertRange(IEnumerable<T>, int)
Inserts the elements of a collection into the ObservableCollectionExtended<T> at the specified index.
Parameters
collectionIEnumerable<T>Inserts the items at the specified index.
indexintThe zero-based index at which the new elements should be inserted.
Exceptions
- Argument
Null Exception collectionis null.- Argument
Out OfRange Exception indexis less than 0.-or-indexis greater than Count.
Load(IEnumerable<T>)
Clears the list and Loads the specified items.
Parameters
itemsIEnumerable<T>The items.
OnCollectionChanged(NotifyCollectionChangedEventArgs)
Raises the Collection
Parameters
eNotifyCollection Changed Event Args The Notify
Collection instance containing the event data.Changed Event Args
OnPropertyChanged(PropertyChangedEventArgs)
Raises the Property
Parameters
ePropertyChanged Event Args The Property
Changed instance containing the event data.Event Args
RemoveRange(int, int)
Removes a range of elements from the ObservableCollectionExtended<T>.
Parameters
indexintThe zero-based starting index of the range of elements to remove.
countintThe number of elements to remove.
Exceptions
- Argument
Out OfRange Exception indexis less than 0.-or-countis less than 0.- Argument
Exception indexandcountdo not denote a valid range of elements in the List<T>.
SuspendCount()
Suspends count notifications.
Returns
- IDisposable
A disposable when disposed will reset the count.
SuspendNotifications()
Suspends notifications. When disposed, a reset notification is fired.
Returns
- IDisposable
A disposable when disposed will reset notifications.