*Main purpose of adding the VM in MVVM *
Can we say :
ViewModel was introduced in MVVM for Unit test the Code.
If we compare MVC and MVVM, MVC unit testing the Controller was difficult without View.
So we have added one more layer ViewModel for unit testing the main code.Manage some non persisted data that Model doesn't persists. ViewModel is introduce to manage some non persisted data and as per user input persist that data into database with Model.
Validate data changes in Model and persist as per the Command.
Manage Data Binding.
And also I have seen most MVVM samples for Command binding conatins ViewModel initializing another View on execute of some command. This directly states the view is dependent on ViewModel.
View --> ViewModel --> Model
ViewModel should be a independent testable unit.
Initializing code of view#2 from view#1 should be the part of view#1 code behind file.
Example :
If I want to call a MessageBox(view#2). Message box should be invoked in View#1 and based on message box results(Yes\No) to perform operation, we should call appropriate method in ViewModel#1. With this ViewModel will be independent from view and we can write unit test easily.