简体   繁体   English

Win8 Frame.Navigate到另一个文件夹

[英]Win8 Frame.Navigate to another folder

I have code working to pass users from page to page within a Windows 8 desktop application using the Frame.Navigate method: 我有一些代码正在使用Frame.Navigate方法在Windows 8桌面应用程序中的页面之间传递用户:

this.Frame.Navigate(typeof(BasicPage1));

However if I try to navigate to a page in a subfolder (or in my case, two levels down: /categories/category-name/BasicPage1), it doesn't find the page and blows up. 但是,如果我尝试导航到子文件夹中的页面(或者在我的情况下,向下两个级别:/ categories / category-name / BasicPage1),它将找不到该页面并且将其炸掉。

I've already tried: 我已经尝试过:

this.Frame.Navigate(new Uri("BasicPage1", UriKind.Relative));

but I get an invalid argument error 但我收到无效的参数错误

Cannot convert from 'System.Uri' to 'System.Type' 无法从“ System.Uri”转换为“ System.Type”

I'm totally new to Windows 8 apps, but I've seen that the Navigate Uri has been discontinued in Win8? 我对Windows 8应用程序是完全陌生的,但是我已经看到Navigate Uri在Win8中已经停产了吗?

Any help is appreciated. 任何帮助表示赞赏。

Unlike Windows Phone Frame.Navigate does not take a URI. 与Windows Phone Frame不同,Navigate不采用URI。 Instead it takes the type of the page to which you want to navigate. 而是采用您要导航到的页面的类型。 If the names of classes in varying folders are identical, a fully qualified namespace solves the issue. 如果不同文件夹中的类名相同,则使用完全限定的名称空间可以解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM