Passing a complex object to a page while navigating in a WP7 Silverlight application

Posted by Andreas Grech on Stack Overflow See other posts from Stack Overflow or by Andreas Grech
Published on 2011-01-15T19:10:37Z Indexed on 2011/01/15 19:54 UTC
Read the original article Hit count: 210

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?

© Stack Overflow or respective owner

Related posts about c#

Related posts about Silverlight