This project is read-only.

Two Views/ViewModels - showing window and passing parameter

Nov 8, 2010 at 9:20 PM

Hi,

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: http://nroute.codeplex.com/Thread/View.aspx?ThreadId=227294 - 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 http://www.orktane.com/Blog/post/2010/06/30/Creating-a-Netflix-App-using-nRoute-A-Step-by-Step-Guide.aspx - 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.
Rishi