1 minute read

The difference between a generic list List<T> and an observable collection ObservableCollection<T> is that observable collection includes an interface called "INotifyCollectionChanged".

Another difference lies in databinding.

While setting ItemsSource property of some controls (e.g. datagrid or itemscollection) to every IEnumerable, there is no notification service applied.

But if we bind it to an ObservableCollection, any change in the list is recognized by the control

Example: When a datagrid adds rows, then the observable collection its ItemsSource gets appended by an item.

From the documentation:

ObservableCollection<T>:
Represents a dynamic data collection that provides notifications when items get added, removed, or when the entire list is refreshed.
List<T>:
Represents a strongly typed list of objects that can be accessed by index. Provides methods to search, sort, and manipulate lists.
Performance:
When binding a List<T> to DataGrid, there are no performance issues seen. But if the amount of data increases, there can be a performance bottleneck.
There are no visible performance issues with ObservableCollection<T>