Similar questions have been asked before but this question strives to explore more options and the ability to pass complex objects.
The question is how to pass parameters but it really needs to be broken up into three parts..
- When navigating between pages in an XAML application how do you pass parameters?
- What is the difference between using the Uri navigation and manual navigation?
- How can objects (not just strings) be passed when using Uri navigation?
Example of Uri navigation
page.NavigationService.Navigate(new Uri("/Views/Page.xaml", UriKind.Relative));
Example of manual navigation
page.NavigationService.Navigate(new Page());
The answer to this question applies to WP7, silverlight, WPF and Windows 8.
Note: There is a difference between Silverlight and Windows8
- Windows Phone: pages are navigated to using a Uri and data passed as a query string or an instance
- Windows 8: pages are navigated to by passing the type, and parameters as objects