The recording of the first ever ReactiveUI virtual conference is available on our YouTube Channel.

ObservableCollectionExtended<T> Class

Summary

An override of observable collection which allows the suspension of notifications.
Namespace
DynamicData.Binding
Interfaces
Base Types
  • ObservableCollection<T>
graph BT Type-->Base0["ObservableCollection<T>"] Type-.->Interface0["IObservableCollection<T>"] Type-.->Interface1["INotifyCollectionChanged"] Type-.->Interface2["INotifyPropertyChanged"] Type-.->Interface3["INotifyCollectionChangedSuspender"] click Interface3 "/api/DynamicData.Binding/INotifyCollectionChangedSuspender" Type-.->Interface4["IExtendedList<T>"] Type-.->Interface5["IList<T>"] Type-.->Interface6["ICollection<T>"] Type-.->Interface7["IEnumerable<T>"] Type-.->Interface8["IEnumerable"] Type["ObservableCollectionExtended<T>"] class Type type-node

Syntax

public class ObservableCollectionExtended<T> : ObservableCollection<T>, IObservableCollection<T>, 
    INotifyCollectionChanged, INotifyPropertyChanged, INotifyCollectionChangedSuspender, 
    IExtendedList<T>, IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable

Type Parameters

Name Description
T The type of the item.

Constructors

Name Summary
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.
ObservableCollectionExtended(List<T>) Initializes a new instance of the ObservableCollectionExtended<T> class that contains elements copied from the specified list.

Methods

Name Value Summary
AddRange(IEnumerable<T>) void
Adds the elements of the specified collection to the end of the collection.
InsertRange(IEnumerable<T>, int) void
Inserts the elements of a collection into the ObservableCollectionExtended<T> at the specified index.
Load(IEnumerable<T>) void
Clears the list and Loads the specified items.
OnCollectionChanged(NotifyCollectionChangedEventArgs) void
Raises the INotifyCollectionChanged.CollectionChanged event.
OnPropertyChanged(PropertyChangedEventArgs) void
Raises the INotifyPropertyChanged.PropertyChanged event.
RemoveRange(int, int) void
Removes a range of elements from the ObservableCollectionExtended<T>.
SuspendCount() IDisposable
Suspends count notifications.
SuspendNotifications() IDisposable
Suspends notifications. When disposed, a reset notification is fired.

Extension Methods

Name Value Summary
Add<T>(IEnumerable<T>) void
Adds the items to the specified list.
From ListEx
AddOrInsertRange<T>(IEnumerable<T>, int) void
Adds the range if a negative is specified, otherwise the range is added at the end of the list.
From ListEx
AddRange<T>(IEnumerable<T>) void
Adds the range to the source ist.
From ListEx
AddRange<T>(IEnumerable<T>, int) void
Adds the range to the list. The starting range is at the specified index.
From ListEx
AsArray<T>() T[]
Casts the enumerable to an array if it is already an array. Otherwise call ToArray.
AsList<T>() List<T>
Casts the enumerable to an array if it is already an array. Otherwise call ToList.
AsObservableChangeSet<T, TKey>(Func<T, TKey>, bool) IObservable<IChangeSet<TObject, TKey>>
Converts the enumerable to an observable change set. Generates a snapshot in time based of enumerable.
AsObservableChangeSet<T>(bool) IObservable<IChangeSet<TObject>>
Converts the enumerable to an observable change set. Generates a snapshot in time based of enumerable.
BinarySearch<T, TSearch>(TSearch, Func<TSearch, T, int>) int
Performs a binary search on the specified collection. Thanks to http://stackoverflow.com/questions/967047/how-to-perform-a-binary-search-on-ilistt.
From ListEx
BinarySearch<T>(T) int
Performs a binary search on the specified collection.
From ListEx
BinarySearch<T>(T, IComparer<T>) int
Performs a binary search on the specified collection.
From ListEx
BindCommand<ObservableCollectionExtended<T>, TViewModel, TProp, TControl, TParam>(TViewModel?, Expression<Func<TViewModel, TProp?>>, Expression<Func<ObservableCollectionExtended<T>, TControl>>, Expression<Func<TViewModel, TParam?>>, string?) IReactiveBinding<TView, TProp>
Bind a command from the ViewModel to an explicitly specified control on the View.
BindCommand<ObservableCollectionExtended<T>, TViewModel, TProp, TControl, TParam>(TViewModel?, Expression<Func<TViewModel, TProp?>>, Expression<Func<ObservableCollectionExtended<T>, TControl>>, IObservable<TParam?>, string?) IReactiveBinding<TView, TProp>
Bind a command from the ViewModel to an explicitly specified control on the View.
BindCommand<ObservableCollectionExtended<T>, TViewModel, TProp, TControl>(TViewModel?, Expression<Func<TViewModel, TProp?>>, Expression<Func<ObservableCollectionExtended<T>, TControl>>, string?) IReactiveBinding<TView, TProp>
Bind a command from the ViewModel to an explicitly specified control on the View.
BindValidation<ObservableCollectionExtended<T>, TViewModel, TViewModelProperty, TViewProperty>(TViewModel?, Expression<Func<TViewModel, TViewModelProperty>>, Expression<Func<ObservableCollectionExtended<T>, TViewProperty>>, IValidationTextFormatter<string>?) IDisposable
Binds the specified ViewModel property validation to the View property.
BindValidation<ObservableCollectionExtended<T>, TViewModel, TViewModelProperty>(TViewModel?, Expression<Func<TViewModel, TViewModelProperty>>, TextInputLayout, IValidationTextFormatter<string>?) IDisposable
Platform binding to the TextInputLayout.
BindValidation<ObservableCollectionExtended<T>, TViewModel, TViewModelProperty>(TViewModel?, Expression<Func<TViewModel, TViewModelProperty>>, TextInputLayout, IValidationTextFormatter<string>?) IDisposable
Platform binding to the TextInputLayout.
BindValidation<ObservableCollectionExtended<T>, TViewModel, TViewProperty>(TViewModel?, Expression<Func<ObservableCollectionExtended<T>, TViewProperty>>, IValidationTextFormatter<string>?) IDisposable
Binds the overall validation of a ViewModel to a specified View property.
BindValidation<ObservableCollectionExtended<T>, TViewModel, TViewProperty>(TViewModel?, Expression<Func<TViewModel?, ValidationHelper>>, Expression<Func<ObservableCollectionExtended<T>, TViewProperty>>, IValidationTextFormatter<string>?) IDisposable
Binds a ValidationHelper from a ViewModel to a specified View property.
BindValidation<ObservableCollectionExtended<T>, TViewModel>(TViewModel?, Expression<Func<TViewModel?, ValidationHelper>>, TextInputLayout, IValidationTextFormatter<string>?) IDisposable
Platform binding to the TextInputLayout.
BindValidation<ObservableCollectionExtended<T>, TViewModel>(TViewModel?, Expression<Func<TViewModel?, ValidationHelper>>, TextInputLayout, IValidationTextFormatter<string>?) IDisposable
Platform binding to the TextInputLayout.
BindValidationEx<ObservableCollectionExtended<T>, TViewModel, TViewModelProperty>(TViewModel?, Expression<Func<TViewModel, TViewModelProperty>>, TextInputLayout, IValidationTextFormatter<string>?) IDisposable
Platform binding to the TextInputLayout.
BindValidationEx<ObservableCollectionExtended<T>, TViewModel, TViewModelProperty>(TViewModel?, Expression<Func<TViewModel, TViewModelProperty>>, TextInputLayout, IValidationTextFormatter<string>?) IDisposable
Platform binding to the TextInputLayout.
Clone<T>(IChangeSet<T>) void
Clones the list from the specified change set.
From ListEx
Clone<T>(IChangeSet<T>, IEqualityComparer<T>?) void
Clones the list from the specified change set.
From ListEx
Clone<T>(IEnumerable<Change<T>>, IEqualityComparer<T>?) void
Clones the list from the specified enumerable of changes.
From ListEx
Duplicates<T, TValue>(Func<T, TValue>) IEnumerable<T>
Returns any duplicated values from the source.
FirstOrOptional<T>(Func<T, bool>) Optional<T>
Overloads Enumerable.FirstOrDefault() and wraps the result in a Optional &gt;T container.
IndexOf<T>(T) int
Finds the index of the current item using the specified equality comparer.
From ListEx
IndexOf<T>(T, IEqualityComparer<T>) int
Finds the index of the current item using the specified equality comparer.
From ListEx
IndexOfMany<T>(IEnumerable<T>) IEnumerable<ItemWithIndex<T>>
Finds the index of many items as specified in the secondary enumerable.
IndexOfMany<T, TResult>(IEnumerable<T>, Func<T, int, TResult>) IEnumerable<TResult>
Finds the index of many items as specified in the secondary enumerable.
IndexOfOptional<T>(T, IEqualityComparer<T>?) Optional<ItemWithIndex<T>>
Lookups the item using the specified comparer. If matched, the item's index is also returned.
From ListEx
InvokeViewModelAction<T>(Action<T>) object
This is a thing I lifted from Prism.
Remove<T>(IEnumerable<T>) void
Removes the items from the specified list.
From ListEx
RemoveMany<T>(IEnumerable<T>) void
Removes many items from the collection in an optimal way.
From ListEx
Replace<T>(T, T) void
Replaces the specified item.
From ListEx
Replace<T>(T, T, IEqualityComparer<T>) void
Replaces the specified item.
From ListEx
ReplaceOrAdd<T>(T, T) void
Replaces the item if found, otherwise the item is added to the list.
From ListEx
With<ObservableCollectionExtended<T>, TKey, TField>(Dictionary<TKey, TField>, IDictionary<TKey, TField>) TBuilder
Adds the specified dictionary to the provided dictionary.