View Single Post
Old January 15, 2022, 17:30   #6
Dean Anderson
Join Date: Nov 2009
Posts: 187
Dean Anderson is on a distinguished road
So, I've done some more research, and as is so often the case with Microsoft the initial claims seem to be more marketing fluff than reality.

In practise, you can write fully portable code in .NET 6, but only if you stick to simple console apps with no UI.

If you want to write apps with a UI, you have basically three choices...

1) Windows Forms or Windows Presentation Framework (WPF). These are the standard UI options for the older .NET Framework, and they are what Cthangband currently uses. Specifically, Cthangband uses WPF, because (unlike Windows Forms, which is very old and only kept going for backwards compatibility) WPF takes advantage of hardware acceleration. While you can still write Windows Forms apps or WPF apps in .NET 6, they are Windows-only, so if you use them in your application it stops being portable.

2) Multi-platform Application User Interface (MAUI). This is the new UI library for .NET 6, and is an expansion of the older third party Xamarin. It is portable, but designed for mobile rather than desktop, so the choice of platform is Android, iOS, or Windows. It doesn't support MacOS or Linux (although I think you can use Mac Catalyst to run the iOS apps it creates on MacOS).

3) Blazor. I didn't look into this too deeply, but it seems to be Microsoft's new attempt at a web UI. It strikes me as probably having the lifespan and take-up of Silverlight, so I ignored it.

This is all rather disappointing, because none of the above give me a UI that can be used on Windows, MacOS, and Linux.
Dean Anderson is offline   Reply With Quote