Pros and Cons of using Observable Collection over IEnumerable

后端 未结 4 1343
轮回少年
轮回少年 2020-12-18 07:42

I am trying to decide if I want to switch all of my IEnumerable collections over to Observable Collections. I cannot find a good explanation of this. What are t

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-18 08:03

    The entire point of Observable collections is that they implement the following interfaces

     INotifyCollectionChanged, INotifyPropertyChanged 
    

    This makes it very easy to alert the UI/ViewModel of changes and update accordingly. If you didn't use ObservableCollection you would be required to implement the updates to the collection/properties yourself manually.

提交回复
热议问题