简体   繁体   English

无法浏览WP8-> WP7(XNA)

[英]Unable to navigate WP8 -> WP7 (XNA)

I have a big project which include 2 little projects ( 1 WP8 and 1 WP7 with XNA), when I try to navigate from project WP8 to project WP7 I encounter this error: 我有一个大项目,其中包括2个小项目(带有XNA的1个WP8和1个WP7),当我尝试从项目WP8导航到项目WP7时,遇到此错误:

System.InvalidOperationException: No XAML was found at the location '/test;component/GamePage.xaml'. System.InvalidOperationException:在“ /test;component/GamePage.xaml”位置找不到XAML。

My project called "test" is in reference in project WP8. 我的项目“ test”在项目WP8中得到了引用。 To focus the problem I made a try, I have create a third project called "test2" in WP7 without XNA, and when I try to navigate WP8 -> WP7 without XNA it's a success, but also fail for WP8 -> WP7 -> WP7(XNA). 为了解决我尝试的问题,我在没有XNA的WP7中创建了一个名为“ test2”的第三个项目,当我尝试在没有XNA的情况下导航WP8-> WP7时成功了,但对于WP8-> WP7->也失败了WP7(XNA)。

To navigate from different project I use that (example): 要从其他项目导航,请使用该示例(示例):

NavigationService.Navigate(new Uri("/test;component/GamePage.xaml", UriKind.Relative));

So the problem come from XNA. 因此问题出在XNA。 Anyone got a solution to permit navigation in different projects that includes XNA? 任何人都拥有允许在包括XNA在内的不同项目中导航的解决方案吗?

If I get your problem, here is my answer. 如果我遇到您的问题, 就是我的答案。

XNA hasn't the concept of page. XNA没有页面的概念。 If you need to "navigate" you have to use Silverlight in your WP7 project. 如果需要“导航”,则必须在WP7项目中使用Silverlight。 Otherwise, if you can't use Silverlight, you have to implement your "page" class that will manage what you need (buttons and detecting touches) and then, when you want to launch the GamePage you simply call it, hiding or deactivating the menu class. 否则,如果您不能使用Silverlight,则必须实现“页面”类,该类将管理所需的内容(按钮和检测触摸),然后,当您要启动GamePage ,只需对其进行调用即可,即隐藏或停用该页面。菜单类。
Of course every page has to inherit from DrawableGameComponent . 当然,每个页面都必须继承DrawableGameComponent

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

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