How to windows phone: navigation to the page in c# ?

Navigating Between Pages.

windows phone navigate to page,

Below several ways to pass data to another page:


1.You can use query parameters as Shawn suggested.
2.You can use global data stored somewhere like in app.cs
3.You can use a static class to hold the data.
4.You can use a shared viewModel to hold the parameters. (or static properties in the viewmodel)


You can also take help query parameters and NavigationEventArgs.You can use the NavigationEventArgs to define if the user is going forword or background by checking the NavigationModel.If you want to download by using the query parameters so can tell page 2.

Write the below code in page 1.

private void MoveToPage2FromPage1()


NavigationService.Navigate(new Uri("/Page2.xaml?shouldDownload=true", UriKind.Relative));


Write the below code in page 2.

protected override void OnNavigatedTo(NavigationEventArgs e)


  if (e.NavigationMode == NavigationMode.Back) return;

  string shouldDownload = "";   //May not be needed if you'll only ever go to page 2 from page 1 to download...

  if (NavigationContext.QueryString.TryGetValue("shouldDownload", out shouldDownload))





About the Author