簡體   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