Table of Contents

Class DispatcherObservableCollection<TItem>

Namespace
Ecng.ComponentModel
Assembly
Ecng.ComponentModel.dll

The class represents a synchronized collection that can be used in WPF applications.

public class DispatcherObservableCollection<TItem> : BaseObservableCollection, ISynchronizedCollection<TItem>, ISynchronizedCollection, IListEx<TItem>, IList<TItem>, ICollection<TItem>, IEnumerable<TItem>, ICollectionEx<TItem>, IList, ICollection, IEnumerable

Type Parameters

TItem
Inheritance
DispatcherObservableCollection<TItem>
Implements
ISynchronizedCollection<TItem>
ISynchronizedCollection
IListEx<TItem>
IList<TItem>
ICollectionEx<TItem>
Derived
Inherited Members
Extension Methods

Constructors

DispatcherObservableCollection(IDispatcher, IListEx<TItem>)

The class represents a synchronized collection that can be used in WPF applications.

public DispatcherObservableCollection(IDispatcher dispatcher, IListEx<TItem> items)

Parameters

dispatcher IDispatcher
items IListEx<TItem>

Properties

Count

public override int Count { get; }

Property Value

int

Dispatcher

public IDispatcher Dispatcher { get; }

Property Value

IDispatcher

IsReadOnly

public bool IsReadOnly { get; }

Property Value

bool

this[int]

public TItem this[int index] { get; set; }

Parameters

index int

Property Value

TItem

Items

public IListEx<TItem> Items { get; }

Property Value

IListEx<TItem>

SyncRoot

public SyncObject SyncRoot { get; }

Property Value

SyncObject

Methods

Add(TItem)

public virtual void Add(TItem item)

Parameters

item TItem

AddRange(IEnumerable<TItem>)

public virtual void AddRange(IEnumerable<TItem> items)

Parameters

items IEnumerable<TItem>

Clear()

public virtual void Clear()

Contains(TItem)

public bool Contains(TItem item)

Parameters

item TItem

Returns

bool

CopyTo(TItem[], int)

public void CopyTo(TItem[] array, int arrayIndex)

Parameters

array TItem[]
arrayIndex int

GetEnumerator()

public IEnumerator<TItem> GetEnumerator()

Returns

IEnumerator<TItem>

IndexOf(TItem)

public int IndexOf(TItem item)

Parameters

item TItem

Returns

int

Insert(int, TItem)

public void Insert(int index, TItem item)

Parameters

index int
item TItem

Remove(TItem)

public virtual bool Remove(TItem item)

Parameters

item TItem

Returns

bool

RemoveAt(int)

public void RemoveAt(int index)

Parameters

index int

RemoveRange(IEnumerable<TItem>)

Remove range of items.

public virtual void RemoveRange(IEnumerable<TItem> items)

Parameters

items IEnumerable<TItem>

Items.

RemoveRange(int, int)

public override int RemoveRange(int index, int count)

Parameters

index int
count int

Returns

int

Events

AddedRange

public event Action<IEnumerable<TItem>> AddedRange

Event Type

Action<IEnumerable<TItem>>

AfterUpdate

public event Action AfterUpdate

Event Type

Action

BeforeUpdate

public event Action BeforeUpdate

Event Type

Action

RemovedRange

public event Action<IEnumerable<TItem>> RemovedRange

Event Type

Action<IEnumerable<TItem>>