使用 NavigationService 导航到代码隐藏中的新页面
我想访问我的页面来设置 XAML 页面:
Dim Pg As New PageListPickerSelection
Pg.StartCalculating(199,"Z-UU", MyCalculationDataIEnumList, myImageSource)
App.NavigationService.Navigate(New Uri("/uc/ListPicker/PageListPickerSelection.xaml", UriKind.Relative))
但是 NavigationService.Navigate 不支持对象
或引用的页面。
显示自己页面的正确步骤是怎样的?
或者换个方式问:“WP7中的ListPicker”如何解决这个问题当显示他的分离页面时?
问候
I want to access my page to setup the XAML Page:
Dim Pg As New PageListPickerSelection
Pg.StartCalculating(199,"Z-UU", MyCalculationDataIEnumList, myImageSource)
App.NavigationService.Navigate(New Uri("/uc/ListPicker/PageListPickerSelection.xaml", UriKind.Relative))
But NavigationService.Navigate does not support Objects
or referenced pages.
How is the correct procedure to show the own page?
Or asked in another way: How does the "ListPicker in the WP7" solve this when showing his separated page?
Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果我理解您的问题,您是在问如何在导航到页面之前配置该页面,对吗?
当您动态导航到页面时,导航服务将创建您的页面。不可能将页面作为对象提供给导航服务如果您需要将数据传递到页面中,您可以使用将参数附加到 URI 的常规方法(使用 C#,因为我不熟悉 VB):
稍后在 PageListPickerSelection 的 OnNavigateTo() 方法中,您可以再次解析参数,如下所示:
If I understand your question, you are asking how to configure a page before navigating to it, correct?
The navigation service will create your pages as you navigate to them on the fly. It is not possible to give the navigation service the page as an object If you need to pass data into a page you can use the normal method of appending params to a URI as such (using c# as I am not familiar with VB):
Later in the PageListPickerSelection's OnNavigatedTo() method you can parse the parameters again as such:
您可以使用一个静态类,其中有几个静态值,您可以在离开第一页时写入这些静态值,并在打开第二页时读取这些静态值。
如果您不喜欢静态类/变量,您可以使用单例。
You could use a static class in which you have a couple of static values which you write when leaving the first page and read when opening the second page.
If you don't like static classes / variables you could use a singleton.