geek geek - 2 months ago 10
C# Question

What is the use of ObservableCollection in .net?

What is the use of ObservableCollection in .net?

Liz Liz
Answer

An ObservableCollection works essentially like a regular collection except that it implements the interfaces:

  • INotifyCollectionChanged,
  • INotifyPropertyChanged

As such it is very useful when you want to know when the collection has changed. An event is triggered that will tell the user what entries have been added/removed or moved.

More importantly they are very useful when using databinding on a form.

Comments