0

What is an ObservableCollection in c# and an implementation of it with list where when the list is updated our ObservableCollection will also get's updated? I tried to understand it but no online forum gave clear explanation and also tried to implement the code in console app but no luck.. please help or guide a way to understand.

prabhaat
  • 53
  • 8
  • https://learn.microsoft.com/en-us/dotnet/api/system.collections.objectmodel.observablecollection-1 – Christopher Feb 10 '20 at 11:16
  • Console Apps do not really gain anything from Change Notification. Same about ASP.Net and videogames. They are mostly usefull in GUI environments - WPF/UWP primarily, but also for WindowsForms. – Christopher Feb 10 '20 at 11:18
  • So, i cannot see updates in console if i do so passing list to ObservableCollection. Am I right ? or Is there something i'm missing please Help and thank alot for the Answer. – prabhaat Feb 10 '20 at 11:32
  • You could connect anything to the `CollectionChanged` event, so if you wanted to you could write the changes to your console. You could also create something that sends an email everytime the collection changes, your imagination is the limit. It's normal use however is with GUI environments, a lot of GUI frameworks have support for `ObservableCollection` automatically updating the visuals according to the added/removed items of a bound `ObservableCollection`. –  Feb 10 '20 at 12:11

0 Answers0