Is there a cross-platform GUI framework for C#/.NET?

28,774

Solution 1

There's Eto.Forms (on github), which is an abstraction layer on top of WPF, WinForms, GTK, and MonoMac/Cocoa - so you can get a native UI on all platforms without having to re-implement for each platform. You don't have to suffer from lowest common denominator, since you can implement specifics for each platform (if desired, but not required).

It has an advantage that it is pure .NET and only relies on OS-supplied dependencies, as opposed to using GTK or WxWidgets where you'd have to bundle the native binaries for various platforms.

Solution 2

Probably GTK# would be the closest.

I know others have said mono, but that's not quite right. .Net is to mono as Microsoft's Java VM is to Sun's Java runtime. mono's not really in the same conceptual space as Swing. For that, GTK# is a closer match.

Solution 3

This page has a list of the GUI toolkits supported by Mono, including pros and cons for each of them. As others have suggested, WinForms, GTK#, and wxNet are all viable options.

Solution 4

I believe a good portion of WinForms is implemented in Mono. You need to install Mono under Linux for that. You may have compatibility problems, though, since Mono is not a Microsoft effort and is not officially supported by them.

Solution 5

Microsoft just recently launched .NET MAUI, which builds on Xamarian and supports .NET core.

In their words:

As we consider what building device applications will look like in a unified .NET, we see many devices across multiple platforms used, from Android and iOS to Windows and macOS. To address this need we are excited to announce a new first-class UI framework for doing just that: .NET Multi-platform App UI, affectionately call .NET MAUI.

.NET MAUI simplifies the choices for .NET developers, providing a single stack that supports all modern workloads: Android, iOS, macOS, and Windows.

Although they do not specify Linux, according to the MAUI Github Repo there is community developed support for it.

Share:
28,774
user507401
Author by

user507401

I've been developing Java code for about 15 years now. However, I'm still capable of asking really dumb questions.

Updated on May 20, 2020

Comments

  • user507401
    user507401 about 4 years

    Let's say just for the joy of it, I decide that I don't want to write desktop applications in Java any more, instead want to switch to using C#. I want to be able to build an application that will run on some mainstream Linux distribution, and a recent release of MS Windows. It will have a GUI component.

    In Java I can build an application that uses Swing. Once I have it working, I can copy that jar file from Windows to Linux or vice versa, depending where I developed it. And it will generally run with java -jar myapp.jar.

    In C# is it possible to do this? Is there a functional equivalent to Swing or AWT in C#?