Konrad Viltersten
Konrad Viltersten

Reputation: 39058

Controls are updated by INotifyPropertyChanged but not the list in the DataGrid

I've implemented INotifyPropertyChanged and the update in my GUI works as supposed to. If the view model changes a value, the control in the window updates.

However, I also have a DataGrid control and the update in view model doesn't propagate to the GUI. If I change something in the the table and invoke store, the changed values are available for VM, including newly added rows.

I've looked at other classes, like INotifyCollectionChanged but got no wiser. Should I move over and use ObservableCollection or is there a more recommended approach?

Upvotes: 0

Views: 52

Answers (1)

Kelly
Kelly

Reputation: 7183

IObservable is the way to go to notify the View of changes. As you have mentioned you models are already implenting INotifyPropertyChanged, so your in a good spot to take advantage of it.

Upvotes: 1

Related Questions