The model is the scope of your application and therefore contains your domain logic, such as business rules and checks. ViewModel is the model for your view. It handles the interactions between the user and the view, that is, when the user clicks the button, the view model processes this interaction and may or may not make changes to the model. Usually in OO, you want your objects to have only one responsibility.
In WPF, ViewModel typically implements the INotifyPropertyChange interface, which is then viewed when viewing for any changes. You would not want the model to implement this interface, since it is not associated with your domain.
Another reason for the separation is that sometimes you may not need to present all the data in the model. For example, if your model provides 15 properties, but in one of your views, the user should see only 5 of these properties. If you put your model in the ViewModel, the view will be displayed for all 15 properties, whereas if you encapsulate the model in the ViewModel, only 5 properties will be displayed in the view.
There are probably many more reasons, but overall it's a good design to keep them out of the way. With that said, if your application is small enough, you can walk away with the model and ViewModel together to reduce code redundancy.
Hoang dang
source share