I have seen the same issue with a lot MVVM implementations when it comes to (modal) dialogs. When I look at the participants of the MVVM Pattern then I have the feeling that something is missing to build a coherent application.
- View contains the specific GUI controls and defines the appearance of the user interface.
- ViewModel represents the state and behavior of the presentation.
- Model can be a business object from the domain layer or a service which provides the necessary data.
But missing is:
- Who creates the ViewModels?
- Who is responsible for the application workflow?
- Who mediates between ViewModels when they need to communicate with each other?
My approach is to introduce a (Use-Case) Controller which is responsible for the missing points. How this works can be seen at the WPF Application Framework (WAF) sample applications.