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);

}

 

posted on 2015-10-27 17:53  lzn1007  阅读(136)  评论(0编辑  收藏  举报

导航