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
T
The 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
collection
IEnumerable<T>The collection from which the elements are copied.
Exceptions
- Argument
Null Exception The
collection
parameter cannot be null.
ObservableCollectionExtended(List<T>)
Initializes a new instance of the ObservableCollectionExtended<T> class that contains elements copied from the specified list.
Parameters
list
List<T>The list from which the elements are copied.
Exceptions
- Argument
Null Exception The
list
parameter cannot be null.
Methods
AddRange(IEnumerable<T>)
Adds the elements of the specified collection to the end of the collection.
Parameters
collection
IEnumerable<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 collection
is null.
InsertRange(IEnumerable<T>, int)
Inserts the elements of a collection into the ObservableCollectionExtended<T> at the specified index.
Parameters
collection
IEnumerable<T>Inserts the items at the specified index.
index
intThe zero-based index at which the new elements should be inserted.
Exceptions
- Argument
Null Exception collection
is null.- Argument
Out OfRange Exception index
is less than 0.-or-index
is greater than Count.
Load(IEnumerable<T>)
Clears the list and Loads the specified items.
Parameters
items
IEnumerable<T>The items.
OnCollectionChanged(NotifyCollectionChangedEventArgs)
Raises the Collection
Parameters
e
NotifyCollection Changed Event Args The Notify
Collection instance containing the event data.Changed Event Args
OnPropertyChanged(PropertyChangedEventArgs)
Raises the Property
Parameters
e
PropertyChanged 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
index
intThe zero-based starting index of the range of elements to remove.
count
intThe number of elements to remove.
Exceptions
- Argument
Out OfRange Exception index
is less than 0.-or-count
is less than 0.- Argument
Exception index
andcount
do 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.