This project is read-only.

Two Views/ViewModels - showing window and passing parameter

Nov 8, 2010 at 9:20 PM


let's say we have this kind of situation. I have a normal WPF app using nRoute. MainWindow (View), MainWindowsViewModel, SecondWindow (View) and SecondWindowViewModel.

In my MainWindowViewModel I have a property which returns a vaulie. Now in MainWindo I would like to have a button which would launch SecondWindow in the fashion of Show/ShowDialog in WinForms while passing my property from MainWindowViewModel to the SecondWindowViewModel - how can I achieve this?

Nov 8, 2010 at 10:35 PM

Have a look at this: - note my comments about proxy'ing the navigation request.

And another possible solution is to implement something akin to the popup container shown in this example - the limitation with this approach is that you'll only have one model open at a time which may or may not apply in your case.

Let me know if it works for you.