We’re doing a WPF application using Prism.
We’re using the ‘view-first’ approach where our views are injected with the VM (IFooViewModel).
We want to hook up a UI action in a view to display a modal dialog box. We want to do this the ‘proper’ Prism way, i.e. just specifying a URI and not hard-coding a particular View or ViewModel.
There seems to be very few examples of achieving this seemingly trivial goal.
As I assume you are also using the DI containers from PRISM, you can try using Inversion of Control. Basicly what you do is the following.
Each view has it’s own interface. In that interface you define your code with events and such. You then inject the Interface into the viewmodel without it ever knowing anything about the view. Except the necessary events of course