Passing a complex object to a page while navigating in a WP7 Silverlight application
- by Andreas Grech
I have been using the NavigationService's Navigate method to navigate to other pages in my WP7 Silverlight app:
NavigationService.Navigate(new Uri("/Somepage.xaml?val=dreas", UriKind.Relative));
From Somepage.xaml, I then retrieve the query string parameters as follows:
string val;
NavigationContext.QueryString.TryGetValue("val", out val);
I now need a way to pass a complex object using a similar manner. How can I do this without having to serialize the object every time I need to pass it to a new page?