This project has moved and is read-only. For the latest updates, please go here.

MvvmLight application with page navigation - send parameters

Jun 18, 2013 at 4:04 PM
I have a WPF application with Page navigation. I use MvvmLight toolkit. I have two pages: FirstPage (default page) and SecondPage. On FirstPage I navigate to SecondPage.

I want to pass a parameter to SecondPage.
//code on FirstPage
NavigationService.NavigateTo(new Uri("SecondPage.xaml", UriKind.Relative));
Messenger.Default.Send<string>("my mess");

//code on SecondPage
public SecondPage()
  Messenger.Default.Register<string>(this, GetMess);

private void GetMess(string obj)

When you first start it's not working. I can create an instance of SecondPage,
PageSecond page = new  PageSecond();
but it is not beautiful. Help me please.