How are WPF observable collections different from simple .NET collections? (.NET WPF Interview questions)
Simple .NET collections do not notify the UI automatically when elements are added or removed from them. So when we update simple .NET collection's we need to send refresh events back to the WPF UI for rebinding the collection.
"ObservableCollection" are specialized collection which updates the UI automatically and immediately when new elements are added and removed from the collection.
"ObservableCollection" implement's "INotifyCollectionChanged "interface. This interface exposes "CollectionChanged" event which gets raised when elements are added or removed to the collection.
Below is a simple code which creates "ObservableCollection" collection which is binded with a list.
Below is one more important WPF Interview questions which is asked in all WPF interviews as the first question. Below is an awesome youtube video which answers this question in more detail.