Search⌘ K
AI Features

ObservableCollection

Explore how to use ObservableCollection<T> in C# to create collections that notify the UI when items change. Learn to subscribe to the CollectionChanged event to keep interfaces updated dynamically as items are added, removed, or replaced.

We'll cover the following...

Overview

Imagine we’re building an application to manage notes. We can add and delete notes. We want the user interface to update itself whenever an item is added or deleted. How do we know when this occurs?

A good approach is to use events. The ObservableCollection<T> is a collection just like List<T>, but it exposes the CollectionChanged event that is ...