New to Telerik UI for WPFStart a free 30-day trial

An observable collection which splits the CollectionChanged event into separate events.

Definition

Constructors

Initializes a new instance of the BaseCollection<T> class.

C#
public BaseCollection()

Initializes a new instance of the BaseCollection<T> class.

C#
public BaseCollection(bool raiseEventsByDefault)
Parameters:raiseEventsByDefaultbool

The raise events by default.

Initializes a new instance of the BaseCollection<T> class. Initializes a new instance of the BaseCollection<T> class.

C#
public BaseCollection(IEnumerable<T> collection)
Parameters:collectionIEnumerable<T>

The collection.

Methods

Adds and new item to the collection and specifies whether to raise the ItemAdded event.

C#
public void Add(T item, bool raise)
Parameters:itemT

The item to add to the collection.

raisebool

Whether to raise the ItemAdded event.

Adds an item to the collection.

C#
public void Add(T item)
Parameters:itemT

The item to be added.

Clears this collection.

C#
public void Clear()

Clears this collection.

C#
public void Clear(bool raise)
Parameters:raisebool

Whether to raise the Cleared event.

Inserts an item to this collection.

C#
public void Insert(int index, T item, bool raise)
Parameters:indexint

The index at which the item should be inserted.

itemT

The item to insert.

raisebool

Whether to raise the ItemInserted event.

Inserts an item to this collection.

C#
public void Insert(int index, T item)
Parameters:indexint

The index at which the item should be inserted.

itemT

The item to insert.

Removes an item from this collection.

C#
public void Remove(T item, bool raise)
Parameters:itemT

The item to remove.

raisebool

Whether to raise the ItemRemoved event.

Removes an item from this collection.

C#
public void Remove(T item)
Parameters:itemT

The item to remove.

Events

Occurs when the collection is cleared.

C#
public event EventHandler Cleared

Occurs when an item is added.

C#
public event EventHandler<GenericEventArgs<T>> ItemAdded

Occurs when an item is inserted.

C#
public event EventHandler<GenericEventArgs<T>> ItemInserted

Occurs when an item is removed.

C#
public event EventHandler<GenericEventArgs<T>> ItemRemoved