There is not a general agreement about that question. For example it was one of the open questions about MVVM formulated by Ward Bell here:
Is the VM allowed to offer the V an
unwrapped M-object (e.g., the raw
Employee) ? Or must the M-object’s
properties (if it is even permitted to
have properties!) be exposed
exclusively through the surface of a
VM wrapper?
The principal advantages of not directly exposing the Model in the VM are:
-
you can use it as a “converter on steroids”, formating the model values in a convenient way for the view
-
you can inject other funcionality related to the user interface, like data validation messages, undo redo,..
The cons are:
-
you will have to duplicate a lot of code to expose all the models properties in the viewmodel.
-
if you bind the view control to the viewmodels property, you will send the propertyChanged events from the viewmodel. But what happens if the models property change from other source different from the viewmodel setter? Then it has to notify the viewmodel so you end with 2 OnPropertyChanged, one in the model and one in the viewmodel… quite complex!
So for me the correct answer is: it depends on your requirements.