Amazing Cross Platform ANSI art editor  - image 839d03fd b00f 4ef3 a7b3 84f071a7b6c7 - Cross-platform GUIs with open source .NET using Eto.FormsThis is one of those “Did you know you could do THAT?” Many folks have figured out that C#/F#/.NET is cross-platform and open0source and runs on basically any operating system. People are using it to create micro services, sites, and webAPI’s all over. Not to mention iPhone/Android apps with Xamarin and video games with Unity and MonoGame.

But what about cross platform UIs?

While not officially supported by Microsoft – you can do some awesome stuff…as is how Open Source is supposed to work! Remember that there’s a family of . Runtimes now, there’s the . Framework on Windows, there’s xplat . Core, and there’s xplat Mono.

Eto.Forms has been in development since 2012 and is a cross-platform framework for creating GUI (Graphical User Interface, natch) applications with .NET that run across multiple platforms using their native toolkit. Not like Java in the 90s with custom painted buttons on canvas.

It’s being used for stuff! In fact, PabloDraw is an Ansi/Ascii text editor that you didn’t know you needed in your life. But you do. It runs on Windows, Mac, and Linux and was written using Eto.Forms but has a native UI on each platform. Be sure to check out Curtis Wensley’s Twitter account for some cool examples of what PabloDraw and Eto.Forms can do!

  • OS X: MonoMac or Xamarin.Mac (and also iOS via Xamarin)
  • Linux: GTK# 2 or 3
  • Windows: Windows Forms (using GDI or Direct2D) or WPF

Here’s an example Hello World. Note that it’s not just Code First, you can also use Xaml, or even Json (.jeto) to layout your forms!

using Eto.Forms;
using Eto.Drawing;

public class MyForm : Form
public MyForm ()
Title = "My Cross-Platform App";
ClientSize = new Size(200, 200);
Content = new Label { Text = "Hello World!" };

static void Main()
new Application().Run(new MyForm());

Or I can just File | New Project with their Visual Studio Extension. You should definitely give it a try.

image  - image a75ea251 9469 4bb4 8ca0 5e095002781f - Cross-platform GUIs with open source .NET using Eto.Forms

Even on the same platform (Windows in the below example) amazingly Eto.Forms can use whatever Native Controls you prefer. Here’s a great example zip that has precompiled test apps.

WinForms, WPF, and Direct2D apps  - image 62ff8ab8 bff0 4f17 bbfc 380b27681045 - Cross-platform GUIs with open source .NET using Eto.Forms

Once you’ve installed a new version of Mono on Ubuntu, you can run the same sample as Gtk3, as I’m doing here in a VM. AMAZING.

image  - image 4cb4353e 735d 437e 9929 79e1d24c5139 - Cross-platform GUIs with open source .NET using Eto.Forms

Here’s some example applications that are in the wild, using Eto.Forms:

There’s so much cool stuff happening in open source .NET right now, and Eto.Forms is actively looking for help. Go check out their excellent Wiki, read the Tutorials, and maybe get involved!

Sponsor: Get the latest JetBrains Rider for debugging third-party .NET code, Smart Step Into, more debugger improvements, C# Interactive, new project wizard, and formatting code in columns.

Source link


Please enter your comment!
Please enter your name here