【问题标题】:Hosting XNA in a WPF application在 WPF 应用程序中托管 XNA
【发布时间】:2014-03-24 09:04:30
【问题描述】:

我想在 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.'

我该如何解决这个问题?

【问题讨论】:

    标签: c# wpf xna embed


    【解决方案1】:

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

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

    【讨论】:

    • 确实,这就是问题所在!谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-20
    • 1970-01-01
    • 1970-01-01
    • 2011-06-29
    • 2018-03-10
    相关资源
    最近更新 更多