繁体   English   中英

在WPF应用程序中托管XNA

[英]Hosting XNA in a WPF application

我想在WPF中创建一个地图编辑器应用程序,并且正在使用XNA作为游戏引擎。

我遵循了一些教程,将我的XNA游戏嵌入到WPF应用程序中,但是我无法使用其中的任何一个。

我在这里找到了一个非常简单的教程:(它是法语,但是所有代码都在这里) http://remember.waralan.fr/?p=497

但是,当我编译时,这是我的错误:

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.'

我该如何解决?

我检查了源代码,它似乎正在工作。 您只需要检查未包括的相关资源文件,例如“ white.xnb”。 只是不要使用它(在代码中注释用法行)或在内容文件夹中使用您自己的自定义资源。

构建目录中的文件位置应为:“ Content / white.xnb

暂无
暂无

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

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