MVVM / ObservableCollection Question

后端 未结 6 980
陌清茗
陌清茗 2021-01-19 15:32

I have the following XAML:

   
        

        
6条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-19 16:09

    You should not need to notify if the collection itself adds or removes items. However, if you swap the whole collection out with a new/different instance (i.e. familyList = new ObservableCollection()) you need to notify. If you are indeed changing the instance, consider clearing/repopulating the collection instead.

提交回复
热议问题