Class TrulyObservableCollection<T>
This class extends the System.Collections.ObjectModel.ObservableCollection<T> for generic content types that
implement System.ComponentModel.INotifyPropertyChanged and does send the System.Collections.ObjectModel.ObservableCollection<T>.CollectionChanged
event also when an element of the collection changes.
This is the intended behaviour of the System.Collections.ObjectModel.ObservableCollection<T> and documented as such in
the MSDN, however, it does not work as intended.
Inheritance
System.Object
System.Collections.ObjectModel.Collection<T>
System.Collections.ObjectModel.ObservableCollection<T>
TrulyObservableCollection<T>
Implements
System.Collections.Generic.IList<T>
System.Collections.Generic.ICollection<T>
System.Collections.Generic.IReadOnlyList<T>
System.Collections.Generic.IReadOnlyCollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IList
System.Collections.ICollection
System.Collections.IEnumerable
System.Collections.Specialized.INotifyCollectionChanged
System.ComponentModel.INotifyPropertyChanged
Inherited Members
System.Collections.ObjectModel.ObservableCollection<T>.BlockReentrancy()
System.Collections.ObjectModel.ObservableCollection<T>.CheckReentrancy()
System.Collections.ObjectModel.ObservableCollection<T>.InsertItem(System.Int32, T)
System.Collections.ObjectModel.ObservableCollection<T>.Move(System.Int32, System.Int32)
System.Collections.ObjectModel.ObservableCollection<T>.MoveItem(System.Int32, System.Int32)
System.Collections.ObjectModel.ObservableCollection<T>.OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs)
System.Collections.ObjectModel.ObservableCollection<T>.OnPropertyChanged(System.ComponentModel.PropertyChangedEventArgs)
System.Collections.ObjectModel.ObservableCollection<T>.RemoveItem(System.Int32)
System.Collections.ObjectModel.ObservableCollection<T>.SetItem(System.Int32, T)
System.Collections.ObjectModel.ObservableCollection<T>.CollectionChanged
System.Collections.ObjectModel.ObservableCollection<T>.PropertyChanged
System.Collections.ObjectModel.ObservableCollection<T>.System.ComponentModel.INotifyPropertyChanged.PropertyChanged
System.Collections.ObjectModel.Collection<T>.System.Collections.IList.get_Item(System.Int32)
System.Collections.ObjectModel.Collection<T>.System.Collections.IList.set_Item(System.Int32, System.Object)
System.Collections.ObjectModel.Collection<T>.Add(T)
System.Collections.ObjectModel.Collection<T>.Clear()
System.Collections.ObjectModel.Collection<T>.Contains(T)
System.Collections.ObjectModel.Collection<T>.CopyTo(T[], System.Int32)
System.Collections.ObjectModel.Collection<T>.GetEnumerator()
System.Collections.ObjectModel.Collection<T>.IndexOf(T)
System.Collections.ObjectModel.Collection<T>.Insert(System.Int32, T)
System.Collections.ObjectModel.Collection<T>.Remove(T)
System.Collections.ObjectModel.Collection<T>.RemoveAt(System.Int32)
System.Collections.ObjectModel.Collection<T>.System.Collections.ICollection.CopyTo(System.Array, System.Int32)
System.Collections.ObjectModel.Collection<T>.System.Collections.IEnumerable.GetEnumerator()
System.Collections.ObjectModel.Collection<T>.System.Collections.IList.Add(System.Object)
System.Collections.ObjectModel.Collection<T>.System.Collections.IList.Contains(System.Object)
System.Collections.ObjectModel.Collection<T>.System.Collections.IList.IndexOf(System.Object)
System.Collections.ObjectModel.Collection<T>.System.Collections.IList.Insert(System.Int32, System.Object)
System.Collections.ObjectModel.Collection<T>.System.Collections.IList.Remove(System.Object)
System.Collections.ObjectModel.Collection<T>.Count
System.Collections.ObjectModel.Collection<T>.Item[System.Int32]
System.Collections.ObjectModel.Collection<T>.Items
System.Collections.ObjectModel.Collection<T>.System.Collections.Generic.ICollection<T>.IsReadOnly
System.Collections.ObjectModel.Collection<T>.System.Collections.ICollection.IsSynchronized
System.Collections.ObjectModel.Collection<T>.System.Collections.ICollection.SyncRoot
System.Collections.ObjectModel.Collection<T>.System.Collections.IList.IsFixedSize
System.Collections.ObjectModel.Collection<T>.System.Collections.IList.IsReadOnly
System.Collections.ObjectModel.Collection<T>.System.Collections.IList.Item[System.Int32]
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Dangl
Assembly: Dangl.Common.dll
Syntax
public sealed class TrulyObservableCollection<T> : ObservableCollection<T>, IList<T>, ICollection<T>, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IList, ICollection, IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged where T : INotifyPropertyChanged
Type Parameters
Name |
Description |
T |
Collection type that implements System.ComponentModel.INotifyPropertyChanged.
|
Constructors
|
Improve this Doc
View Source
TrulyObservableCollection()
Will initialize with a hook to the System.Collections.ObjectModel.ObservableCollection<T>.CollectionChanged event and add or remove event listeners
to the items in the collection.
Declaration
public TrulyObservableCollection()
|
Improve this Doc
View Source
TrulyObservableCollection(IEnumerable<T>)
Will initialize with a hook to the System.Collections.ObjectModel.ObservableCollection<T>.CollectionChanged event and add or remove event listeners
to the items in the collection.
Declaration
public TrulyObservableCollection(IEnumerable<T> collection)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<T> |
collection |
The System.Collections.Generic.IEnumerable<T> from which to seed.
|
Methods
|
Improve this Doc
View Source
AddRange(IEnumerable<T>)
Adds the elements of the specified collection to the end of the System.Collections.ObjectModel.ObservableCollection<T>.
Declaration
public void AddRange(IEnumerable<T> collection)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<T> |
collection |
The collection whose elements should be added to the end of the System.Collections.ObjectModel.ObservableCollection<T>.
The collection itself cannot be null, but it can contain elements that are null, if type T is a reference type.
|
Exceptions
Type |
Condition |
System.ArgumentNullException |
collection is null.
|
|
Improve this Doc
View Source
ClearItems()
This first removes all event subscriptions to 'PropertyChanged' on the
'Items' and then calls the base method.
Declaration
protected override void ClearItems()
Overrides
System.Collections.ObjectModel.ObservableCollection<T>.ClearItems()
|
Improve this Doc
View Source
InsertRange(Int32, IEnumerable<T>)
Inserts the elements of a collection into the System.Collections.ObjectModel.ObservableCollection<T> at the specified index.
Declaration
public void InsertRange(int index, IEnumerable<T> collection)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
The zero-based index at which the new elements should be inserted.
|
System.Collections.Generic.IEnumerable<T> |
collection |
The collection whose elements should be inserted into the List<T>.
The collection itself cannot be null, but it can contain elements that are null, if type T is a reference type.
|
Exceptions
Type |
Condition |
System.ArgumentNullException |
collection is null.
|
System.ArgumentOutOfRangeException |
index is not in the collection range.
|
Implements
System.Collections.Generic.IList<T>
System.Collections.Generic.ICollection<T>
System.Collections.Generic.IReadOnlyList<T>
System.Collections.Generic.IReadOnlyCollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IList
System.Collections.ICollection
System.Collections.IEnumerable
System.Collections.Specialized.INotifyCollectionChanged
System.ComponentModel.INotifyPropertyChanged