将 WPF 程序移至 Linux
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/49574372/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Moving a WPF program to Linux
提问by Jeff Godzilla
I have a C# WPF program that I've been working on for a while now and I need to move to Linux. I know that Moonlight is dead and Monodevelop has no future plans of implementing WPF functionality. Does anyone have any advice for the most painless way to rebuild my program in Linux? It's a DnD character generator that uses a GUI with tab controls to separate the different parts. I only know C# but I'd learn another language if it was the best way.
我有一个 C# WPF 程序,我已经研究了一段时间,我需要转移到 Linux。我知道 Moonlight 已经死了,Monodevelop 没有实现 WPF 功能的未来计划。有没有人对在 Linux 中重建我的程序的最轻松方法有什么建议?它是一个 DnD 字符生成器,它使用带有选项卡控件的 GUI 来分隔不同的部分。我只知道 C#,但如果这是最好的方法,我会学习另一种语言。
采纳答案by Christopher
The .NET Framework was planned for Platform independant, but that never realised. It grew too big to fully port.
.NET Framework 计划独立于平台,但从未实现。它变得太大而无法完全移植。
.NET Core does not have that issue. It was cut down compared to the .NET Framework. It supports neither WPF nor Windows Forms, but it does support something similar: UWP. Wich is basically "WPF with App environment added". Since your programm propably needs no extensvie rights, UWP might be the way to go.
.NET Core 没有这个问题。与 .NET Framework 相比,它被缩减了。它既不支持 WPF 也不支持 Windows 窗体,但它确实支持类似的东西:UWP。Wich基本上是“添加了应用程序环境的WPF”。由于您的程序可能不需要扩展权限,UWP 可能是要走的路。
Edit: With .NET Core 3.0, thie Windows Forms Support will be added again. .NET Framework targetting WinForms Programms will need a conversion, but if you start from scratch it should just work.
编辑:使用 .NET Core 3.0,将再次添加 Windows 窗体支持。面向 WinForms 程序的 .NET Framework需要转换,但如果您从头开始,它应该可以正常工作。
Otherwise the common GUI to do cross platform anything is Xamarian. But Xamarian Apps are usually designed from the get go as such.
否则,做跨平台任何事情的通用 GUI 就是 Xamarian。但是 Xamarian 应用程序通常是从一开始就设计的。

