[英]Page navigation WP8.1
I made an app to WP8 and I used the page navigation like NavigationService.Navigate(new Uri(...))
and worked well. 我为WP8制作了一个应用程序,我使用了
NavigationService.Navigate(new Uri(...))
类的页面导航,效果很好。
But now I'm trying to develop a WP8.1 app and can't figure out how is it going. 但现在我正在尝试开发一个WP8.1应用程序,但无法弄清楚它是怎么回事。
I get the following error The name 'NavigationService' does not exist in the current context
. 我收到以下错误
The name 'NavigationService' does not exist in the current context
。
I have two pages and I want to navigate between them. 我有两页,我想在它们之间导航。
How can I do? 我能怎么做?
What changed? 改变了什么?
For Universal Apps (Windows Runtime), you need to use the Frame.Navigate(...)
overload, with the type of the page you're navigating to. 对于通用应用程序(Windows运行时),您需要使用
Frame.Navigate(...)
重载,以及您要导航到的页面类型。
To navigate to MainPage.xaml, you can use Frame.Navigate(typeof(MainPage));
要导航到MainPage.xaml,可以使用
Frame.Navigate(typeof(MainPage));
I'll recommend reading Quickstart: Navigating between pages (Windows Runtime apps using C#/VB/C++ and XAML) (MSDN) 我建议阅读快速入门:在页面之间导航(使用C#/ VB / C ++和XAML的Windows运行时应用程序)(MSDN)
You can navigate using 您可以使用导航
Frame.Navigate(typeof(MainPage));
Frame.Navigate(typeof运算(的MainPage));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.