6

Can I mix MonoGame with XAML in WPF appliaction? For example: core of game written in MonoGame, but UI written in XAML and placed on top of MonoGame-Canvas. I know that I can use XAML on MonoGame in WinRT. Can I do same things in WPF?

AndreyAkinshin
  • 18,603
  • 29
  • 96
  • 155

2 Answers2

2

You should read Nick Gravelyn's blog post: http://blogs.msdn.com/b/nicgrave/archive/2010/07/25/rendering-with-xna-framework-4-0-inside-of-a-wpf-application.aspx

That should work for MonoGame as well, except for the last part that uses the content build pipeline as MonoGame does not yet have its own content build pipeline implementation.

You can find some samples here: https://github.com/CartBlanche/MonoGame-Samples

AndreyAkinshin
  • 18,603
  • 29
  • 96
  • 155
  • 2
    There are also WPF examples that come with Monogame now. I use it myself and it works well. – FanerYedermann Oct 24 '12 at 15:21
  • A lot of water has run under the bridge since then, but here you go: https://github.com/CartBlanche/MonoGame-Samples – FanerYedermann Nov 20 '14 at 16:21
  • Just for clarity, this old revision of MonoGame has a submodule reference to that repo: https://github.com/mono/MonoGame/tree/b0a31d8b1b4bae65328f2bf56aae17e5df78a744 – FanerYedermann Nov 20 '14 at 16:22
1

MonoGame 3.2 supports WPF/DirectX interop now. http://www.monogame.net/2014/04/07/monogame-3-2/

kbo4sho88
  • 175
  • 7