windows通用app开发入门-页面间导航
- 导航到指定页面
Frame.Navigate(typeof(NewPage));
- 传递参数
Frame.Navigate(typeof(PasswordDetail), index);
- 接收参数
protected override void OnNavigatedTo(NavigationEventArgs e)
{
int i= (int)e.Parameter;
}
- 清除导航缓存,避免按返回键时导航到上一个界面
protected override void OnNavigatedTo(NavigationEventArgs e)
{
Frame rootFrame = Window.Current.Content as Frame;
rootFrame.BackStack.Clear();
base.OnNavigatedTo(e);
}