Windows Phone 7 页面间传值

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

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

rom:http://www.189works.com/article-10971-1.html

posted @ 2013-01-16 10:35  hack25  阅读(167)  评论(0编辑  收藏  举报