monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white">1.页面传值:
this.NavigationService.Navigate(new Uri("/SecondPage.xaml?CustomerId=1234&Product=555", UriKind.Relative));
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
foreach (var item in NavigationContext.QueryString)
{
MessageBox.Show("Query String [" + item.Key + "] = " + item.Value);
}
}
或:
this.NavigationService.Navigate(new Uri("/SecondPage.xaml#HelloWorld",
UriKind.Relative));
Protected override void OnFragmentNavigation(System.Windows.Navigation.FragmentNavigationEventArgs e)
{
base.OnFragmentNavigation(e);
MessageBox.Show("Fragment: " + e.Fragment);
}
2.在非页面层调用页面跳转:
//跳转页面
(Application.Current.RootVisual as Microsoft.Phone.Controls.PhoneApplicationFrame
).Navigate(new Uri("/MainPages/SecondPages/GameDetails.xaml", UriKind.Relative));