.NET MAUI › Advanced Data Binding & Collections

What is ObservableCollection and why use it for lists?

Beginner

Answer

ObservableCollection<T> implements INotifyCollectionChanged, so adding/removing items automatically updates a bound CollectionView without rebinding. Use it for dynamic lists. Note that replacing the whole collection still requires a property change notification on the property holding it.
public ObservableCollection<Item> Items { get; } = new();
Items.Add(newItem);   // UI updates automatically
Real-world example A chat list appends incoming messages to an ObservableCollection and they appear instantly without refreshing the whole view.

Common follow-ups: Does it notify on item property changes? | What if you replace the collection?