Are the any samples of Monogame in WPF with a working contentmanager?

I found the wpf interop solution on git, its great but it doesn’t use the contentManager, I tried to port the old xna-winforms content loading tutorial but it’s errored out atm, Does anyone have a sample I can have a read through?

What is the error that you are seeing?

I put the issue on stackoverflow here as well
but basically

Depending on whether I use IntPtr.Zero or the actual window handle to create the instance of GraphicsDevice I get a different error.

I gave up and Im using HelixToolkit for the time being (which is a whack of controls built ontop of media3d and SharpDX), loading a model and displaying it is trivial compared :stuck_out_tongue:

I got the game to work with a WindowsFormHost element, but I get in trouble with the airspace issue.

I found this sample https://github.com/CartBlanche/MonoGame-Samples/tree/master/WpfInteropSample
Is it still up to date?
How can I use the ContentManager? Is there any example of how I do this?

I also find this recent sample http://panthernet.ru/en/component/jdownloads/viewcategory/3-graphx

Hi, the best solution i found was from tgjones awnser Monogame 3.2 with WPF Editor

I made an entire testing here

sweet thanks for the headsup, Ill use that later on in my gamedev, even though I gave up on it for the original issue

Hi @jetbuster, I had the same issue with the content manager. I was helped by @HelmutG as shown in this post:

YAY! I finally get to return something to the community.

I have actually run into all these same problems when I leveraged the existing sample code from the MonoGame repository.

Consequently I have built my own branch of this code and put it together in a new project for everyone to access. You can download it from here, It is a complete working version of the engine running inside a WPF window along with the ContentManager. I’ve been using this code for a number of months now and it seems quite stable.

Hi, I just found your solution. I’m having some problems with it. When trying to start fiddle with the project you submitted it only gives me "Cannot create an instance of “ProjectionHost”. In the layout builder. I’m wondering if I’m doing something wrong? I simply started the solution, updated the project so that it could be used with Visual Studio 2015 and tried opening the layout builder. This is what it looks like: http://i.imgur.com/8LYLcpM.png

I just had the same problem, but fixed it by opening the the .csproj-file in an editor and change to the following reference and hint path:

<Reference Include="MonoGame.Framework">
<HintPath>$(MSBuildProgramFiles32)\MonoGame\v3.0\Assemblies\Windows\MonoGame.Framework.dll</HintPath>
</Reference>

Awesome! I can’t get it working though. What did you change it from, and what did you change it to? I’ve gotten as far as to get this