Table of Contents

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
ObservableCollection2<T>
Implements
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 int
item 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 int
item T

Events

ItemReplaced

an item was replaced

public event EventHandler<(object? oldItem, object? newItem)>? ItemReplaced

Event Type

EventHandler<(object oldItem, object newItem)>

ItemsAdded

one or more items added

public event EventHandler<IList>? ItemsAdded

Event Type

EventHandler<IList>

ItemsRemoved

one or more items removed

public event EventHandler<IList>? ItemsRemoved

Event Type

EventHandler<IList>