Embed MonoGame inside an AvaloniaUI control.

This question might be better suited for the AvaloniaUI team but I figured I would try here first.

I’m in the process of porting my editor from WPF to Avalonia so that it can be cross platform (Windows, Linux and MacOS) and I just ran into my first roadblock. Previously, I’ve been using MonoGame.WpfCore to render my game in a WPF app and I’d like to do the same in Avalonia.

Has anyone tried that before? Is it even possible?

Unfortunately I know next to nothing about OpenGL, Skia and such. Looking at the source code, it looks like one wold be able to use Avalonia’s OpenGlControlBase as seen in this example to accomplish that.

I’d be willing to port MonoGame.WpfCore to Avalonia myself but as of now, I have no clue how I could pull this off. Any help would be greatly appreciated.

Thanks! :slight_smile:

i use WPF plus one of the monogame backing store samples that speaks to the directx… and comiled it with Netcore 6 using microsoft poritng tool, some command line things that converted the whole level editor… . 99% was without a hitch… even the scripting works… the monogame stuff says invalid handle at runtime but nearly everythign works. now… so I m thinking why avalonia… it was amazing that it worked… i havent tried wpf on other plafroms but its supposed to work…