简体   繁体   English

在WPF应用程序中托管XNA

[英]Hosting XNA in a WPF application

I want to create a Map Editor application in WPF, and I'm using XNA as the game engine. 我想在WPF中创建一个地图编辑器应用程序,并且正在使用XNA作为游戏引擎。

I followed several tutorials to embed my XNA game into a WPF application, but I couldn't get working any of them. 我遵循了一些教程,将我的XNA游戏嵌入到WPF应用程序中,但是我无法使用其中的任何一个。

I found a tutorial which is pretty simple here: (It's in french but all the code is here) http://remember.waralan.fr/?p=497 我在这里找到了一个非常简单的教程:(它是法语,但是所有代码都在这里) http://remember.waralan.fr/?p=497

But when I compile, here's my error: 但是,当我编译时,这是我的错误:

A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll

Additional information: Additional information: 'The invocation of the constructor on type 'WpfApplication1.MainWindow' that matches the specified binding constraints threw an exception.'

How can I fix that? 我该如何解决?

I've checked the source code and it seems to be working. 我检查了源代码,它似乎正在工作。 You just have to check the associated resource files like "white.xnb" that is not included. 您只需要检查未包括的相关资源文件,例如“ white.xnb”。 Just don't use it (comment usage lines in code) or use your own custom resources in content folder. 只是不要使用它(在代码中注释用法行)或在内容文件夹中使用您自己的自定义资源。

Supposed file location in build directory is: " Content / white.xnb " 构建目录中的文件位置应为:“ Content / white.xnb

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

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