Class ObservableCollection2<T>
- Namespace
- SearchAThing.Ext
- Assembly
- netcore-ext.dll
ObservableCollection specialized with ItemsAdded, ItemsRemoved that allow to track for Clear, Remove, Insert, Set actions
public class ObservableCollection2<T> : ObservableCollection<T>, IList<T>, ICollection<T>, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IList, ICollection, IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged, INotifyCollectionChanged2
Type Parameters
T
- ObservableCollection specialized with ItemsAdded, ItemsRemoved that allow to track for Clear, Remove, Insert, Set actions
- Inheritance
-
Collection<T>ObservableCollection2<T>
- Implements
-
IList<T>ICollection<T>IEnumerable<T>
- Inherited Members
- Extension Methods
Examples
\snippet ObservableCollection/ObservableCollectionTest_0001.cs example
Constructors
ObservableCollection2()
public ObservableCollection2()
ObservableCollection2(IEnumerable<T>)
public ObservableCollection2(IEnumerable<T> items)
Parameters
items
IEnumerable<T>
Methods
ClearItems()
override clear items
protected override void ClearItems()
InsertItem(int, T)
protected override void InsertItem(int index, T item)
Parameters
index
intitem
T
RemoveItem(int)
protected override void RemoveItem(int index)
Parameters
index
int
SetItem(int, T)
protected override void SetItem(int index, T item)
Parameters
index
intitem
T
Events
ItemReplaced
an item was replaced
public event EventHandler<(object? oldItem, object? newItem)>? ItemReplaced
Event Type
ItemsAdded
one or more items added
public event EventHandler<IList>? ItemsAdded
Event Type
ItemsRemoved
one or more items removed
public event EventHandler<IList>? ItemsRemoved