导航服务.GoBack();问题

发布于 2024-09-29 15:05:38 字数 198 浏览 0 评论 0原文

当我调用 NavigationService.GoBack(); 时它不会重新加载页面。

例如,我的第 1 页是我的登录页面,然后我导航到第 2 页的“设置”页面。当我在第 2 页上保存我的设置后,我希望它导航回第 1 页并显示所显示的新设置。

我可以拨打任何电话让导航服务返回并强制页面重新初始化吗? (即调用页面加载方法)。

谢谢

When I call NavigationService.GoBack(); it doesn't reload the page.

For example I have Page 1 which is my Login page, then I Navigate to Page 2 to the Settings Page. When I have saved my Settings on Page 2 I wish it to Navigate back to Page 1 and show the new settings that are displayed.

Is there any call I can make where the Navigate Service Goes Back AND forces the page to re-initialise? (ie call the page loaded method).

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

能否归途做我良人 2024-10-06 15:05:38

解决了。 使用

protected override void OnNavigatedTo( System.Windows.Navigation.NavigationEventArgs e) { //INSERT RELOAD METHOD HERE }

在每个页面的 PhoneApplicationPage 部分中

Solved it. Use

protected override void OnNavigatedTo( System.Windows.Navigation.NavigationEventArgs e) { //INSERT RELOAD METHOD HERE }

In the PhoneApplicationPage part of every page

成熟的代价 2024-10-06 15:05:38

当您导航到下一页时,上一页将被销毁(如果它不运行后台线程)。您有多种方法可以显示第 1 页上的设置。

当用户登录并转到第 2 页时,将您的设置保存到独立存储中,当他按下后退按钮时,使用

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{

  var settings = LoadMySettingsFromIS();
  if (settings =! null)
  {
    // update it here
  }

  base.OnNavigatedTo(e);

}

When you navigate to next page the previous page is destroyed (if it does not run the background thread). You have a sevral ways to display settings on page nr 1.

When user log in and go to page 2 save your setting to the Isolated Storage and when he presses the back button use

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{

  var settings = LoadMySettingsFromIS();
  if (settings =! null)
  {
    // update it here
  }

  base.OnNavigatedTo(e);

}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文