是否有C#/ .NET的跨平台GUI框架? [英] Is there a cross-platform GUI framework for C#/.NET?
问题描述
让我们说只是为了它的乐趣,我决定不再用Java编写桌面应用程序,而是想切换到使用C#。我希望能够构建一个将在某些主流Linux发行版上运行的应用程序,以及最近发布的MS Windows。它将有一个GUI组件。
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.
在Java中,我可以构建一个使用Swing的应用程序。一旦我有它工作,我可以将该jar文件从Windows复制到Linux,反之亦然,这取决于我开发它的位置。它通常用 java -jar myapp.jar
运行。
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
.
在C#中可以这样做吗?在C#中是否有与Swing或AWT相同的功能?
In C# is it possible to do this? Is there a functional equivalent to Swing or AWT in C#?
推荐答案
这里有 Eto.Forms (在github上),它是 WPF , WinForms 之上的抽象层, GTK 和 MonoMac / Cocoa - 这样您就可以在所有平台上获得本机UI,而无需为每个平台重新实施。您不必受最低公分母的影响,因为您可以为每个平台实现细节(如果需要,但不是必需的)。
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).
它有一个优势,它是纯.NET,只依赖于操作系统提供的依赖,而不是使用GTK或WxWidgets,你必须捆绑各种平台的本机二进制文件。
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.
这篇关于是否有C#/ .NET的跨平台GUI框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!