The role of the model in MVVM

后端 未结 3 512
慢半拍i
慢半拍i 2020-12-28 12:46

I\'ve read a few articles regarding the role of the (Data)Model in the MVVM pattern. However, i still could not figure what goes into the model.

Should the model imp

3条回答
  •  暖寄归人
    2020-12-28 13:12

    In some cases a Model must implement INotifyPropertyChanged. Imagine that you are coding client for ICQ or something like that. How is the ViewModel supposed to know, that somebody send you a message?

    Difference between Model and ViewModel:

    A ViewModel only simplifies the output from a Model. If the model is very simple, a ViewModel isn't necessary.

提交回复
热议问题