MVVM / ObservableCollection Question

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

I have the following XAML:

   
        

        
6条回答
  •  没有蜡笔的小新
    2021-01-19 16:03

    The ObservableCollection's implementation of INotifyPropertyChanged is basically used to react to adding to or removing from that collection.

    You need to call Notify...() in the setter, because the collection is a property of your ViewModel and the DataGrid will not react to any changes of your ViewModel's properties, unless you call Notify...() when changed.

    Edit: I'm too slow.

提交回复
热议问题