Special Offer: My C#/.NET Bootcamp Course is out now. Get 10% OFF using the code FRIENDS10.

The landscape of different user interface (UI) frameworks for .NET desktop development offers many choices.

What’s great for the ecosystem and experienced developers can be challenging for novices and people getting into .NET from other technologies.

The most common user interface frameworks for the .NET platform are:

  • WinForms
  • WPF
  • UWP
  • WinUi 3
  • Xamarin/Xamarin Forms
  • .NET MAUI
  • Platform Uno
  • Avalonia UI
  • Blazor Hybrid

In this article, I will provide the most fundamental information about each technology to help you decide what framework to explore.

I phrased that last sentence carefully. I won’t give an absolute suggestion of what to use for your project. It depends on a lot of context.

However, I want to offer as much help as possible based on 15+ years of experience with the .NET platform.

WinForms

WinForms has been around the longest of all the user interface frameworks listed here.

The age doesn’t tell you the truth here. Usually, 20+ years old technology is outdated when it comes to software development.

WinForms, however, is still in development, and in November 2023, a new version targeting .NET 8 was released.

While the forms designer in Visual Studio allows for quick progress and development, it often breaks when working on complex dialogs. Also, customization is limited.

When it comes to implementing the logic controlling the user interface, WinForms offers code-behind files that provide direct access to user interface controls. Code written like that can become hard to maintain in the long term.

While WinForms is still a viable choice (a good one!) for internal applications, such as configuration tooling or similar, I wouldn’t recommend using it for public-facing applications anymore.

WinForms is limited to running on Windows only.

WPF

Windows Presentation Foundation is Microsoft’s WinForms successor. It uses XAML instead of a visual designer for defining user interfaces.

Besides a component-oriented model offering many customization options, it is a well-established and frequently used user interface framework.

With MVVM and other code separation patterns, WPF is a viable choice for public-facing and growing applications.

I have been using WPF for application development for almost a decade. It has a steep learning curve, and many things, such as component styling, can be done in multiple ways. When using it in a team project, I recommend doing the same things the same way in the whole code base.

One of the most prominent issues with WPF is its subpar performance. The rendering system is complex and allows for various hooks and different control styling approaches. I’m not familiar with what makes it feel slow, but I have seen many complex WPF applications with the typical “WPF performance”. If performance is important to you, consider a different technology.

Similar to WinForms, WPF is still maintained and runs on the latest .NET 8 release. It’s also limited to running on Windows only.

UWP

The Universal Windows Platform (UWP) uses WinRT APIs to provide user interfaces and other system APIs.

UWP apps offer a more modern approach to Windows app development compared to WPF and WinForms. The applications can be deployed to Windows PC, Xbox, holoLens, Surface Hub, and IoT devices using the Microsoft Store.

Similar to WPF, UWP uses XAML to design the user interface. But be warned that there are differences between WPF XAML and UWP XAML. It’s often referred to as different XAML flavors.

UWP apps can not only be developed using C# or any other .NET programming language; you can also use C++, JavaScript, and HTML.

UWP apps run on Windows 10 and Windows 11 devices. They are not backward compatible with older operating system versions.

Even though UWP is still supported, I believe, in most cases, you want to use something different. .NET MAUI offers a cross-platform alternative, while WPF is a great choice for teams that are familiar with it.

WinUi 3 is a great choice when you want the native look and feel of Windows applications and build on the most modern foundation.

WinUi 3

WinUi 3 is the latest evolution of native user interface controls for Windows. WinUi 2 is used in UWP, and WinUi 3 is part of the Windows App SDK.

Compared to WinForms or WPF, WinUI 3 is the most modern user interface implementation. There is built-in support for modern input such as touch, pen, and gamepad, which are missing in the previously named technologies.

WinUi 3 is backward compatible with older Windows versions and runs on Windows only.

Xamarin/Xamarin Forms

Xamarin and Xamarin Forms are widely adopted technologies to implement cross-platform mobile applications initially on Mono, later integrated into the .NET platform.

Similar to WPF and UWP applications, it uses an XAML flavor to define user interfaces.

Starting as a separate company with the same name, Xamarin was acquired by Microsoft in 2016.

While Microsoft initially continued Xamarin Forms for a few years, it has halted its further development, and Xamarin Forms support will end on May 1st, 2024.

Microsoft proclaims .NET MAUI as its successor. At the time of writing this article, there are many known issues with .NET MAUI. Therefore, I’d consider alternatives such as Platform Uno, or Avalonia UI when mobile applications are the focus.

.NET MAUI

MAUI stands for .NET Multi-Platform App UI. It allows building native, cross-platform desktop and mobile apps using a single code base.

It’s developed and maintained by Microsoft and is their most modern approach to building cross-platform .NET desktop applications.

Besides Windows, Android, and iOS, it also supports targeting macOS. It allows you to build mobile and desktop apps for Windows and Apple devices from a single codebase written in C#.

.NET MAUI was first released in May 2020 based on .NET 6.

It acts as the successor of Xamarin and Xamarin Forms, both of which will be out of support in May 2024. It also adds the desktop capabilities from UWP apps but is not limited to Windows devices.

Microsoft pushes .NET MAUI as the future-proof platform for cross-platform desktop and mobile application development.

The lack of Linux support is one of the most discussed issues with the current state of .NET MAUI. Other issues include missing controls that were present in Xamarin Forms.

The overall feedback I heard in my network is that it is not ready yet. I’m a very positive person, and I would consider using it depending on the scope of my project and what previous experience the development has.

Alternatives are Platform Uno and Avalonia UI, neither of which are developed by Microsoft.

Platform Uno

Platform Uno is a cross-platform open-source platform for building a single codebase for native mobile, web, desktop, and embedded apps quickly.

Platform Uno supports Windows 7, 10, 11, Linux, and MacOS for desktop development. For mobile applications, it supports iOS and Android. And you can build web applications using WebAssembly.

Besides its strong cross-platform support, it supports all major .NET development IDEs: Visual Studio, JetBrains Rider, and Visual Studio Code.

You can implement user interfaces declaratively using a XAML flavor, or you can use C# to imperatively define user interfaces. Platform Uno provides a Figma plugin that allows you to transform Figma designs into Platform Uno components in a split second.

Platform Uno is one of my go-to solutions for mobile application development and can be an alternative if migrating from Xamarin Forms to .NET MAUI comes with issues in your situation.

One of the unique features is Linux support, which (at the time of writing this article) .NET MAUI is still lacking.

Under the hood, Platform Uno uses a native stack where possible. It uses WinUI for Windows, Skia for Linux, and Xamarin for mobile applications (Android/iOS).

Hint: The Xamarin libraries are not subject to the end of support of Xamarin Forms. It’s just another instance of bad naming in software engineering.

Avalonia UI

Avalonia UI is an open-source user interface framework for the .NET platform. It supports Windows 7, and newer, MacOS, Linux, iOS, Android, Samsung Tizen, and WebAssembly.

Similar to Platform Uno, Avalonia UI is one of only two frameworks featured in this article that support Linux desktops.

If you are interested in building applications for smartwatches, Samsung Tizen support can be interesting to you. However, this article mainly focuses on desktop development.

Avalonia UI also comes with support for Visual Studio, JetBrains Rider, and Visual Studio Code.

Avalonia UI uses a XAML flavor for its user interface definition. Compared to Platform Uno, we cannot use C# to imperatively declare user interfaces.

Avalonia UI proclaims to be a natural successor to WPF, providing a familiar developer experience combined with cross-platform advantages.

Avalonia UI focuses on a low-level Skia implementation as the base for each target platform. Instead of using WinUI or Xamarin, it focuses on a strong Skia-based implementation combined with platform-specific polyfills. It’s one of the main technological differences between Avalonia UI and Platform Uno.

According to many blog posts and Reddit threads, Avalonia UI is simpler to start with than Platform Uno for most WPF developers.

Blazor Hybrid

Blazor Hybrid allows the integration of Blazor (Razor) components into WPF, .NET MAUI, and WinForms applications.

For the integration, those three platforms use a specific implementation of a BlazorWebView, which encapsulates the Blazor components within the host application.

I’m generally not a friend of using web-based frameworks, such as Blazor, or JavaScript-based frameworks, such as Electron, for native application development.

However, this option might be worth considering if you have a use case with an existing Razor or Blazor code base.

Conclusion

.NET offers many different choices for desktop development, from established and stable Windows-only solutions like WinForms and WPF to modern cross-platform frameworks such as .NET MAUI, Platform Uno, and Avalonia. And, of course, there are some in-betweens.

As stated in the introduction of this article, I don’t want to give you an absolute recommendation on what technology is best for you. It’s only possible to make a decision by knowing your context and project requirements.

If you want to decide between Avalonia UI and Platform Uno, you either try both and see what fits your requirements best (the approach I recommend), or read this detailed comparison by Nick Polyak on Codeproject.

However, I added my personal experience and information from my network to make this article more applicable than a simple feature comparison.

So yes, this article is subjective, and I would happily drink a soda with you whether you had the same or opposite experience with one of the frameworks.

With those words, I want to close this article and wish you all the best with whatever framework you choose. Good luck.

If you aren’t already – consider subscribing to my YouTube channel, where I upload new videos about .NET development weekly.

I wish you a Merry Christmas if you found this article through the .NET Advent Calendar 2023.

 

Claudio Bernasconi

I'm an enthusiastic Software Engineer with a passion for teaching .NET development on YouTube, writing articles about my journey on my blog, and making people smile.