10

EDIT 1 2017/01/29 - At the moment our choice has gone to electron in combination with EdgeJS and all the power of NodeJS and the packages/resources on npm there.. There is no better alternative for us to create cross platform apps for all three plyers (macOS, linux and windows). Thanks everyone for their input.


ORIGINAL Question:
TL;DR - Backend code written in C# (.Net/Mono). Writing a desktop application that needs low level access to the system (cross platform OSX, Linux, Windows 7 to 10). In search of a one-stop cross platform UI tool/framework that can interface with the status of the backend-code, either by polling/messaging or calling into the code of the backend code. This "backend" includes for example the scanning & listing of process info, taking screenshots, etc.. Sending network information (which websites were visited etc..) It's in essence an exam monitor for students when they're doing an online exam in classrooms.**

Options we are exploring:

  • electron (formerly known as atom shell) looks nice, but we have no idea whether it can interop/call into/kickstart a C#/Mono application. Posted this as well on their official forum for feedback, and whether it is a good use case for electron. In an ideal world, we'd like to use electron fully, but unfortunately I think we need platform specific logic (which now we handle in C# w/ .net & mono).
  • Eto.Forms is what we work with now, but is limiting in it's UI's capabilites - as sometimes it still renders differently (sizing of windows) on different platforms. It also has a different look & feel that's tied to the platform of the user - which is a good feature, but it makes it difficult to make dedicated controls to visualise status, which would be easier in html/css.

  • Another route, is a mix between Eto.Forms (or something else) to bootstrap a native UI that hosts a browser in it's window that cross platform and not dependent on the locally installed browsers, such as Awesomium. This would still require Eto.Forms, or any other bootstrapper to kickstart the application, but all other navigation would go through the Awesomium rendered html.

Thanks, Yves

Yves Schelpe
  • 3,343
  • 4
  • 36
  • 69
  • 6
    Electron can play nicely with .NET/Mono via the Edge.js project http://tjanczuk.github.io/edge/#/. Since Electron uses a slightly different version of Node you'll need electron-edge found here: https://github.com/kexplo/electron-edge. I tried this myself doing a little POC project for binding HTML/JS to C# here https://github.com/srakowski/coldstone. It seems to work pretty well. – Shawn Rakowski Mar 15 '16 at 15:51
  • 1
    Perhaps Xojo (http://www.xojo.com)? It creates native desktop apps for OSX/Lin/Win and can interface directly with system APIs. – Paul Lefebvre Mar 15 '16 at 18:29
  • And what about GTK#? it works on all environments. Also you can use xwt over it. – Gusman Mar 15 '16 at 20:06
  • @Gusman thx, I know, I already used that road - but found it cumbersome to create custom controls and a nice user interface cross platform. Whilst our backend company already has a lot of themes and visual styles in HTML, so I figured going with HTML/CSS front-end but delivered in a shell/host would give users a nice experience - even though it's a desktop app. Saves time & money on styling applications in GTK – Yves Schelpe Mar 16 '16 at 08:28
  • thanks @ShawnRakowski - going to take a look at that project. Before I dive in any further: can I kickstart a process via electron + edge.js, say a "service" or "background application" via the C# (.NET/Mono) dll and monitor / interface with it. So that it can keep state and do it's threading stuff etc..? – Yves Schelpe Mar 16 '16 at 08:31
  • 1
    @YvesSchelpe if you *really* want an HTML interface then use the awesomium route, but for my experience an html interface for an application is not a good idea. *Maybe some day Xamarin will port Xamarin.Forms to Linux/Mac, that would be a great day :D* – Gusman Mar 16 '16 at 09:42
  • @Gusman - that would be great, but for now... ;) – Yves Schelpe Mar 16 '16 at 11:07
  • 1
    @YvesSchelpe when you cross over into .NET/Mono objects you create maintain their state between calls and every thing you normally have access to should be available. – Shawn Rakowski Mar 16 '16 at 13:17
  • @YvesSchelpe did you use edge.js as per Shawn's suggestion? I'd be interested to hear how you are getting on. – intinit Apr 27 '17 at 16:00
  • I haven't used it, since I solved all my problems so far by either writing with nodejs ecosystem packages and with integration (per os) on command line utilities... So not yet. – Yves Schelpe Apr 27 '17 at 18:17
  • Have you considered Electron? – Selim Balci Jun 23 '17 at 07:06
  • 1
    @MichaelWayne - read the question/update again it should tell you :-)... but in short: yes! And for a very specific usecase I think electron is useful, although if every app would be written in it, it's overkill.. It needs optimizing and more of chromium taken out of it imho. – Yves Schelpe Jun 24 '17 at 07:28
  • 1
    @YvesSchelpe nice one... If I were you (my humble opinion), I would definitely take advantage of ReactJS. They both play very nice together. – Selim Balci Jun 24 '17 at 12:49
  • @MichaelWayne true, for this project in electron I used reactjs - very powerful combination. You could use Angular too ofcourse, but somehow reactjs felt faster for a smaller scoped electron project. Still prefer angular for web projects though. But true and thanks for the tip. – Yves Schelpe Jun 24 '17 at 14:52
  • https://blog.lextudio.com/the-story-about-net-cross-platform-ui-frameworks-dd4a9433d0ea – Lex Li Jul 07 '19 at 22:38

2 Answers2

2

AvaloniaUI (A cross platform XAML Framework for .NET Framework, .NET Core and Mono) would be a perfect choice if you are familiar with WPF.

There are many other frameworks to develop cross-platform desktop apps. You can checkout my github repo electron-alternatives for more cross-platform desktop development options.

Sudhakar Ramasamy
  • 1,736
  • 1
  • 8
  • 19
-2

Xamarin Forms is my framework of choice. https://visualstudio.microsoft.com/xamarin/ It's made for mobile but was extended to include desktop as well.

Clayton Harbich
  • 505
  • 1
  • 7
  • 16
  • it's not true cross platform when there's no support for linux or mac UI's, I'm sorry.. – Yves Schelpe Nov 15 '18 at 20:09
  • 1
    Maybe not Linux but mac yes https://blog.xamarin.com/building-your-first-macos-app/ – Clayton Harbich Nov 15 '18 at 21:21
  • It's a start, thanks. However for the time being it's the electron way for us when doing projects like this sadly :/ – Yves Schelpe Nov 16 '18 at 07:35
  • I've seen good things out of electron. Xamarin has a big learning curve as well. It will do native code with Platform specific API calls if needed. Most cases probably not needed. – Clayton Harbich Nov 16 '18 at 15:20
  • I was hoping x-plat Forms support would be further along by now, but with no dev. support from MS on macOS/Linux and so much is missing or broken on macOS and also Essentials not getting any macOS/Linux support (not even accepting PRs), I assume nothing will happen on this till after .Net 5 is released and Mono is deprecated. – SushiHangover Jan 17 '20 at 07:23