-7

considering a situation where only the user updates the ViewModels/Models through the UI, there's no external access to the data displayed.

Why does the ViewModel should implement INotifyPropertyChanged in this case?

It makes only sense to me to have a ViewModel implementing it when there's external access to the data so that the UI has to be notified somehow about an external-initiated property-change and you set up Mode=TwoWay/Mode=OneWay.
Most of the sample MVVM implementations I saw never subscribe anything the the ViewModels PropertyChangedEventHandler, but still implement it, just because it has to be done, since it's mvvm.

user3698624
  • 225
  • 1
  • 10
  • 2
    Consider example when two textbox linked to same property. When textbox1 changed, textbox2 should sync to it. – Niyoko Oct 27 '16 at 07:05
  • 2
    You don't need to have anything subscribe to the viewmodels PropertyChangedEventHandler, that is done by using the bindings which will do the subscription. – Janne Matikainen Oct 27 '16 at 07:17
  • I guess if your application only enter data then maybe. But that is a pretty boring application. You have no data validation? A set will never reject an input? – paparazzo Oct 27 '16 at 09:09
  • It sounds like you haven't written an MVVM application, because when you do, you really want the UI to update when the state of your application changes. –  Oct 27 '16 at 14:30
  • Possible duplicate of [In MVVM should the ViewModel or Model implement INotifyPropertyChanged?](http://stackoverflow.com/questions/772214/in-mvvm-should-the-viewmodel-or-model-implement-inotifypropertychanged) – tom redfern Oct 27 '16 at 15:00

1 Answers1

1

If the user changes one item in the view it may affect multiple items in the viewmodel, or it may affect the state of one item in the viewmodel that in turn affects the presentation of multiple items in the view.

I would have to turn the question on its head and ask, given the above statements, why would you not implement INotifyPropertyChanged? It's hardly a massive overhead.

LordWilmore
  • 2,829
  • 2
  • 25
  • 30