what is the difference between list and observable collection?
sakshi sharma
Select an image from your device to upload
Great question! The main difference is notification. A standard List doesn't tell the UI when items are added or removed, so your interface won't update automatically. An ObservableCollection sends those notifications for you. It’s like when I need to destress and play a quick game of kick the buddy; I need the game to react instantly to my taps, just like your UI needs to react instantly to data changes!
I've also been a bit confused about this. Is ObservableCollection only used for WPF data binding, or can it also be used in other .NET applications? -retro games
I’ve always been a bit confused about this too. Is ObservableCollection just for WPF data binding, or can it be used in other .NET applications as well? - space waves
An ObservableCollection can be updated from UI exactly like any collection. The true difference is rather straightforward:
ObservableCollection implements INotifyCollectionChanged which provides notification when the collection is changed
A list provides methods to search, sort, and manipulate lists.