# CollectionChangedHandler<TItem, TCollection> class

Namespace: [Eto](https://eto.picoe.ca/api/namespace/eto.md) · Assembly: [Eto](https://eto.picoe.ca/api/assembly/eto.md)

```cs
public abstract class CollectionChangedHandler<TItem, TCollection>
```

Class to help implement collection changed events on a data store

**Remarks:** This is used for the platform handler of controls that use collections. This class helps detect changes to a collection so that the appropriate action can be taken to update the UI with the changes. This is a simple helper that is much easier to implement than handling the [INotifyCollectionChanged.CollectionChanged](https://learn.microsoft.com/dotnet/api/system.collections.specialized.inotifycollectionchanged.collectionchanged) event directly.

**Type parameters:**

- `TItem`: Type of the items in the collection
- `TCollection` (where class): Type of the collection

**Derived types:** [DataStoreChangedHandler<TItem, TCollection>](https://eto.picoe.ca/api/type/eto.datastorechangedhandler-2.md), [EnumerableChangedHandler<TItem, TCollection>](https://eto.picoe.ca/api/type/eto.enumerablechangedhandler-2.md)

## Properties

- [Collection](https://eto.picoe.ca/api/type/eto.collectionchangedhandler-2/collection.md): Gets the collection that this handler is observing
- [Count](https://eto.picoe.ca/api/type/eto.collectionchangedhandler-2/count.md): Gets the count of the items in the current registered collection.

## Methods

- [AddItem](https://eto.picoe.ca/api/type/eto.collectionchangedhandler-2/additem.md): Adds the item to the end of the collection
- [AddRange](https://eto.picoe.ca/api/type/eto.collectionchangedhandler-2/addrange.md): Adds multiple items to the end of the collection
- [BeginUpdates](https://eto.picoe.ca/api/type/eto.collectionchangedhandler-2/beginupdates.md): Called before any methods to change the collection have been called.
- [ElementAt](https://eto.picoe.ca/api/type/eto.collectionchangedhandler-2/elementat.md): Gets the element at the specified index of the current registered collection.
- [EndUpdates](https://eto.picoe.ca/api/type/eto.collectionchangedhandler-2/endupdates.md): Called after any methods to change the collection have been called.
- [IndexOf](https://eto.picoe.ca/api/type/eto.collectionchangedhandler-2/indexof.md): Gets the index of the specified item
- [InsertItem](https://eto.picoe.ca/api/type/eto.collectionchangedhandler-2/insertitem.md): Inserts an item at the specified index in the collection
- [InsertRange](https://eto.picoe.ca/api/type/eto.collectionchangedhandler-2/insertrange.md): Inserts multiple items to the specified index in the collection
- [InternalElementAt](https://eto.picoe.ca/api/type/eto.collectionchangedhandler-2/internalelementat.md): Gets the element at the specified index.
- [InternalIndexOf](https://eto.picoe.ca/api/type/eto.collectionchangedhandler-2/internalindexof.md): Gets the index of the item from the collection
- [OnRegisterCollection](https://eto.picoe.ca/api/type/eto.collectionchangedhandler-2/onregistercollection.md): Called when the object has been registered (attached) to a collection
- [OnUnregisterCollection](https://eto.picoe.ca/api/type/eto.collectionchangedhandler-2/onunregistercollection.md): Called when the object has unregistered the collection
- [Register](https://eto.picoe.ca/api/type/eto.collectionchangedhandler-2/register.md): Registers a specific collection to observe
- [RemoveAllItems](https://eto.picoe.ca/api/type/eto.collectionchangedhandler-2/removeallitems.md): Removes all items from the collection
- [RemoveItem](https://eto.picoe.ca/api/type/eto.collectionchangedhandler-2/removeitem.md): (2 overloads) Removes the item at the specified index
- [RemoveRange](https://eto.picoe.ca/api/type/eto.collectionchangedhandler-2/removerange.md): (2 overloads) Removes the specified items from the collection
- [ReplaceItem](https://eto.picoe.ca/api/type/eto.collectionchangedhandler-2/replaceitem.md): Replaces the item at the specified index
- [ReplaceRange](https://eto.picoe.ca/api/type/eto.collectionchangedhandler-2/replacerange.md): Replaces a range of items starting at the specified index.
- [Reset](https://eto.picoe.ca/api/type/eto.collectionchangedhandler-2/reset.md): Resets the collection when it is dramatically changed
- [Unregister](https://eto.picoe.ca/api/type/eto.collectionchangedhandler-2/unregister.md): Unregisters the current registered collection
