Monogame in Xamarin / .NET Maui

Is there an actual way to use both Xamarin Forms and Monogame together? I want to create a 3D editor of sorts using a Monogame 3D sub-window for the 3D space, and Xamarin for the UI (like the Unity editor for example). Can I do this with Monogame, or should I use a different 3D engine for Xamarin. If so, any recommendations?

Just use Monogame.forms

I was able to do this with native Xamarin.Android, Xamarin.iOS and a fork off MonoGame 3.71:

The biggest problem is that MonoGame is really sloppy about cleaning up after itself, I had to fix a ton of bugs related to shutting down and restarting new instances of MonoGame in the same app. Also the architecture of MonoGame.iOS is a nightmare, I had to add factory methods 3 layers deep just to subclass the monogame viewcontroller, and sorting out the touches & gestures is a complete headache.

It turned out pretty awesome though, I used it for a note-taking app ScatterNote.com
Everytime the user opens the notebook view, it’s a new instance of MonoGame with native Android & iOS controls layered on top.

Also the recommendation MonoGame.Forms is wrong, that’s for embedding MonoGame in a WinForms project, not Xamarin.Forms.

2 Likes