The .NET Maui team at Microsoft recently dropped Release Candidate 1, so I thought it worth taking a quick look at how it compares to both it’s predecessor, Xamarin.Forms, and the Uno Platform, which is arguably the market leader for building multi-platform application with .NET.
If you missed the announcement by Microsoft, here’s a tweet by David Ortinau which has links to the blog post covering the announcement.
As a starting point for comparing .NET Maui, I’ll start with a table that compares various attributes. The following table originally came from a tweet by Luis Matos and has been updated and extended to include the Uno Platform:
Xamarin.Forms | .NET Maui | Uno Platform | |
---|---|---|---|
Platforms | |||
Android | API 19+ | API 21+ | API 21+ |
iOS | 9-15 | 10+ | 8+ |
Windows | UWP – Microsoft WPF – Community | UWP – Not Supported Win32 (WinUI) – Microsoft | UWP Win32 (WinUI) WPF (Skia) |
MacOS | Community | Microsoft | Uno |
Linux | Community | Community | Uno |
Tizen | Samsung | Samsung | Uno |
Web | – | – | Uno (Wasm) |
Features | |||
Renderers | Tightly coupled to BindableObject | Loosely coupled, no Core dependencies | N/A |
Templated (ala Lookless) Controls | No | No | Yes |
App Models | MVVM, RxUI | MVVM, RxUI, MVU, Blazor | MVVM, MVU-X |
Single Project | No | Yes | Yes |
Multi-Targeting | Yes | Yes | Yes |
Multi-Window | No | Yes | No |
Devices capabilities | Xamarin Essentials | Maui Essentials | Mapped WinRT APIs |
Misc | |||
.NET | Xamarin.iOS, Xamarin.Android, Mono, .NET Framework, … | .NET 6+ | Mix |
Acquisition | NuGet & Visual Studio Installer | dotnet | NuGet (uno-check) |
Project System | Franken-proj | SDK Style | Mix |
dotnet CLI | No | Yes | Yes |
Tools | |||
Visual Studio 2022 | Yes | Yes | Yes |
Visual Studio 2022 for Mac | Yes | Yes | Yes |
Visual Studio Code | No | Yes | Yes |
Services | |||
Figma | No | No | Yes |
Support | GitHub Issue | GitHub Issue | GitHub Issue Paid Support |
Let’s run through some of the notable points in this table:
- Windows support for .NET Maui leverages the recently released Windows App SDK and WinUI, rather than UWP – this will be somewhat limiting in the short term. Whilst the WinAppSdk is clearly the path forward by Microsoft, it still suffers from worse performance than UWP and limitations on some of the built in capabilities that UWP had. By comparison, if you’re building with Uno, you can choose whether your Window app targets UWP or WinUI.
- There’s currently no support for building a web application using either Xamarin.Forms or .NET Maui. Uno leverages webassembly (WASM) to deliver a web application from the same XAML based application logic.
- Uno doesn’t use renderers but does leverage the underlying platform controls. Uno controls are all Templated Controls (aka lookless controls) which means you can completely re-template the control without adjusting their behaviour.
- Uno Extensions support a more reactive style model for building view models using Uno Reactive called MVU-X and advanced region-based navigation model using Uno Navigation.
- .NET Maui includes multi-window support which is something that’s mainly relevant to macOS and Windows where it makes sense to have multiple windows in some applications. Uno applications can leverage multiple windows on Windows using the UWP or WinUI multi-window apis.
- Device capabilities (eg GPS/Location) can be accessed using the Xamarin or Maui Essentials. For Uno applications device capabilities can be accessed using the corresponding WinRT API that has been mapped for each supported platform (eg Geolocation).
- Xamarin.Forms has separate projects for each target platform, each with it’s own project type (hence Franken-proj). .NET Maui uses a single SDK style project (although in theory you could still have a separate project for each target platform). Uno supports targeting Xamarin.iOS / Xamarin.Android, as well as .NET for Android and iOS (net6). This means that depending on which target platforms you opt for, you’ll either use old style projects (ie Franken-proj), or SDK style projects
- Technically all the frameworks support multi-targeting (original table indicated that Xamarin.Forms does not). However, Xamarin.Forms doesn’t use multi-targeting for the target platform projects (unlike .NET Maui that uses multi-targeting to allow it to target multiple platforms from the single project).
- The Uno Platform also offer some additional services such as paid support and a plugin for figma (preview).
The .NET Maui team are edging closer to their GA release and there are still a lot of moving parts that’ll need to come together. Hopefully this comparison is useful if you’re trying to work out which framework to use for building a multi-platform application.