back to article Cross-platform Windows Presentation Framework, anyone? The short answer: yes. Unpacking Avalonia

Avalonia, a cross-platform framework for desktop applications, has built up a considerable user community but is it a viable alternative to Microsoft's official solutions? The name Avalonia will be familiar to long-term .NET developers. Avalon was the code name for Windows Presentation Foundation (WPF), one of the “three …

  1. Mike 137 Silver badge

    Thank you!

    "based on WPF though it is not 100 per cent compatible"

    Just what's needed in a successor framework.

    1. Warm Braw

      Re: Thank you!

      Neither is UWP...

      Mostly compatible is probably good enough. It would be nice to think there would ultimately be a web version, too, given that Skia can run, up to a point, on WebAssembly. But it's harder than it looks.

      1. Anonymous Coward
        Anonymous Coward

        Re: Thank you!

        "But it's harder than it looks."

        Yes all these whizzy on message alternatives such as Electron, Flutter, Uno, Avalonia etc look great until you look seriously into creating a meaty application, not just a simple PoC. You then realise that you're in relatively uncharted waters and anyone of the myriad of technical hurdles you'll have to overcome could literally cause the whole project to fail. Contrast that with WPF (and Winforms) where any problems you have can usually be solved by a quick Google - although actually the problem with WPF is that there are often too many solutions, and many of them are ridiculously arcane for your average Joe Bloggs dev to understand.

  2. trevorde Silver badge

    Uno as an alternative - just say NO

    TL;DR

    Uno only really supports UWP (Windows). Everything else is incomplete and buggy.

    My current strategy is to use Uno (https://platform.uno/) to develop on Windows (UWP) and target web (WebAssembly).

    There are big, gaping holes in WebAssembly and even bigger holes in Linux support. It's a case of write once, debug everywhere, sell nowhere.

    As an overall strategy, I'd be better off learning any one of the myriad javascript frameworks as they at least work as advertised.

  3. Charlie Clark Silver badge

    Microsoft's long list of dead ends

    For years the world was only allowed to use VB, the web forms came along, then WPF, then something else. WPF had some nice ideas but was one of the reasons why Vista was such a resource hog: would have been easier to go with DisplayPostscript but Microsoft doesn't paying licences (though it expects others to pay), which is why the world gets one shitty knock-off typeface (Arial, Verdana, …) after another.

    Leaves two choices: QT, which just works and something like Flutter, where Google does at least ensure the web components do work.

    1. Anonymous Coward
      Anonymous Coward

      Re: Microsoft's long list of dead ends

      I'm not sure where you're getting some of that stuff from;

      "For years the world was only allowed to use VB"

      There were always plenty of alternatives to VB for desktop applications. Ever heard of Java or C++ for example? And of course when .Net launched in 2001, C# was born. And we got a proper OO version of VB which I'm still fond of but have been forced over to C# now.

      "the web forms came along"

      Not sure what point you are making, VB is a language, web forms is a framework that enabled VB or C# to be used for the code behind (or other .Net languages as well I guess). Web Forms were aimed at helping WinForms developers make the transition.

      "WPF had some nice ideas but was one of the reasons why Vista was such a resource hog: "

      Hmm, most hardware at the time was specced to support the somewhat lighter requirements of Win XP. You could say Vista was ahead of its time. You could also say it was released in a last minute rush and was poorly optimised and buggy. It was a lot better by SP2. Of course, every one loved Vista Mark 2, which MS wisely called Windows 7! ;) And by that time hardware performance had caught up. I don't think you can blame WPF for Vista's initial problems.

      "would have been easier to go with DisplayPostscript "

      Err except that WPF and DP are not equivalents (DP didn't provide a Windowing system). And in any case, DP is old hat now, so MS were right not to go down that route.

      I'm not sure about knock off typefaces - it's not my thing and frankly I don't care. There's no shortage of typefaces available in the Windows eco system. Is it really an issue in 2021?

      "Leaves two choices: QT, which just works and something like Flutter,"

      The applications I've seen that use QT (for example Anki, the SRS flashcard program) just look like they were done using WinForms, so why bother, at least WinForms is supported by .Net Core (on Windows). QT also has a reputation for being easy to use if you happen to be a C++ dev (don't know how true that is as I've never used it.)

      Flutter seems primarily targeted at Mobile apps, desktop support is only in Beta release - that doesn't inspire confidence. But then again if you're a Flutter mob dev, perhaps you can knock out simple desktop apps in a trice.

      Like it or loath it, WPF is still a strong contender for those desktop applications many businesses still rely on (but shhh don't tell anybody because it's all supposed to be web and mobile now ;)). And at least projects like Avalonia offer the tantalising prospect that your code might be reusable for those web or mobile apps down the line.

      1. NerryTutkins

        Re: Microsoft's long list of dead ends

        I would say another big advantage of this is that it is an open source project that is not controlled or bankrolled by Microsoft. Microsoft seem to introduce new things with big fanfare, have an expensive marketing campaign to get devs on board, push it as the next big thing and insist that in the future this will unify everything and be *the* platform. Couple of years later, someone shuffles on to another job, and new guy comes up with the new "next big thing", following which the last "next big thing" gets unceremoniously dumped and all the devs who invested time and money in it get thrown under the bus.

        1. Anonymous Coward
          Anonymous Coward

          Re: Microsoft's long list of dead ends

          That's certainly happened a lot in the past. But I think you're a bit behind the curve, a lot of Microsoft's major development initiatives are now open source (on GitHub) including WPF, .Net Core, C#, ASP.Net MVC, Winforms (yes even that old doggie ;)). And MS is a big contributor to the Linux Kernel project as well - MS is now quite a different beast from the old Steve Ballmer days! ;)

      2. Charlie Clark Silver badge

        Re: Microsoft's long list of dead ends

        I was commenting mostly on Microsoft's poor attempts at cross-platform GUIs, something I still think they're poorly placed to produce, though they have made considerable strides at least on MacOS with Office ≥ 2016 but they're web-facing stuff is still awful.

    2. Anonymous Coward
      Anonymous Coward

      Re: Google does at least ensure the web components do work

      June 15th, 2022: Google announces that it will drop Flutter for Churner, its new multi-platform web development thingie, based on # (language that replaces Go).

  4. Rafael #872397
    Mushroom

    Perhaps a confusing amount of choices is a healthy thing.

    No.

    A moderate amount of choices with clear development paths and reasonable expectation that the time we invest in those will not be lost is a healthy thing.

  5. ovation1357

    I thought it was all about Electron these days?

    Trouble with that is that it's a big old resource hog - relatively performant but Slack / Teams (for Linux) / Discord all occupy about 500MB of RAM during normal operation (and I'm talking RSS -the virtual size is much bigger) - even with plenty of RAM this starts to add up quickly.

    The trouble now is that the market for 'thick client' desktops apps must surely be shrinking due to everything, for better or worse, becoming a web application; so it's hard to know what's going to happen with desktop frameworks.

    I've always thought it's a huge shame that Microsoft tied WPF to being Windows-only. Not that I'm a particular fan of it per-se but it would be nice to be able to develop a .NET application with a relatively universal GUI just like with Java and Swing. Perhaps Avalonia will bridge this gap?

    I'm an unashamed, Microsoft-hating Linux fan boy yet I have to admit that I loved using C# for a few projects several years ago and would consider it for future projects. If there Avalonia becomes a widely adopted, well supported, cross-platform UI toolkit for .NET Core then I think I'd give it very serious consideration if I need to build a desktop application.

    1. 9Rune5

      all occupy about 500MB of RAM during normal operation

      If only that was all they did...

      Epic's game store currently burns a steady 1% CPU on my 8 core ryzen (16 logical cores). And if I switch to the store view, it burns 3-4% CPU. That does not sound too much, until you realize that it is burning about 20-25% of one core. And it is just sitting there: I'm not even using it. Starting the thing is a monumental task, but I'm guessing a lot of that is spent firing off several http requests to do whatever it needs to do. It is a far cry from Steam and perhaps the reason they have to give away a game every week to persuade punters to not jump ship.

      Cræpware.

      if I need to build a desktop application

      How likely is that? Enterprises seem to shy away from desktop apps in any shape or form? The lure of zero-deployment web apps is very strong. I believe our industry just took a giant step back.

  6. ecofeco Silver badge

    This quote comes to mind

    “All too often, technologists solve problems by introducing additional layers of technology abstractions and disregarding simpler solutions, such as outreach and engagement,”

    - Duane Wessels

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Other stories you might like