WP7中导航页面:

NavigationService.Navigate(new Uri("/Page1.xaml", UriKind.Relative));

WP7中页面间传值:

WP7页面间传值跟普通的web页面间的传值很类似。

this.NavigationService.Navigate(new Uri("/Page1.xaml?pagetitle=hello", UriKind.Relative));

另一个页面取值:

this.PageTitle.Text  = NavigationContext.QueryString["pagetitle"].ToString();

当然可以直接利用应用程序状态来存值:

PhoneApplicationService.Current.State["key"] = "value";

还可以用全局变量来存值,直接利用static来实现,但一般不推荐这样方式。

注意:在页面间存取值,尽量在重载事件OnNavigatedFrom和OnNavbigatedTo里面操作。

相关文章:

  • 2021-06-23
  • 2022-02-06
  • 2021-11-12
  • 2021-09-15
  • 2022-02-14
  • 2022-01-19
  • 2021-06-22
  • 2022-01-29
猜你喜欢
  • 2021-05-03
  • 2021-09-20
  • 2021-09-12
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案