Whatβs New in .NET MAUI? (Features & Performance)

Microsoft has released its long-awaited successor to Xamarin, dubbed .Net MAUI. After months of speculation, Microsoftβs new development framework will be the key to creating mobile and cross-platform applications on the .NET platform. New features, performance benchmarks, release date and more. Hereβs all what you need to know about it!
What is .NET MAUI?
For those who donβt know what is .NET MAUI:
.NET MAUI means .NET Multi-Platform App User Interface (MAUI) and allows us to build native desktop and mobile apps with a single code base. .NET MAUI will be running on .NET 6 (and .NET 7).
According to Microsoft, .NET MAUI is the evolution of Xamarin.Forms, extended from mobile to desktop scenarios, with UI controls rebuilt from scratch for performance and extensibility.

.NET MAUI stands out for its ability toΒ Β (macOS,Β AndroidΒ andΒ Windows)Β into a single API. This will allow developers to have a unified andΒ more comfortable experienceΒ while providing great control over all the functions of each platform (and this is something very cool).
After many people said that it arrives to replace Xamarin, Microsoft had to come out and say that .NET MAUI is complementary to Xamarin.
.NET MAUI Release Date
If you are wondering if is .NET MAUI production ready or if is .NET MAUI released, yes, you can now use .NET MAUI to develop cross-platform applications. Microsoft released on April 12, 2022 the first Release Candidate of .NET MAUI and on April 26 they released Release Candidate 2.
As these releases are under Microsoftβs βgo-liveβ support policy, support from Microsoft is already active for production applications developed with .NET MAUI.
Getting Started with .NET MAUI
Support
If we start by introducing .NET MAUI, .NET 6 will be released in November 2021 and will be supported for three years, as aΒ Long Term Support (LTS) release. TheΒ platform matrixΒ has been significantly expanded compared to .NET 5.
The additions are:
- Android.
- iOS.
- MacΒ andΒ Mac Catalyst, for x64 andΒ Apple SiliconΒ (AKA βM1β).
- Windows Arm64 (specificallyΒ Windows Desktop).
.NET 6 Debian container images are based onΒ Debian 11Β (βbullseyeβ), which is currently inΒ testing.
Startup
The .NET MAUI applications will use a Startup class that will allow:
- ConfigureΒ method to pipe service registration, handler registration, or application customization processes.
- Be able toΒ createΒ a custom HostBuilder.
For instanceΒ π
Loading code snippet...
By default, if you donβt want to customize anything special, or you want to use your own dependency container or something, you can.
Accessibility
Adding more control and improving the accessibilityΒ APIΒ to avoid confusion in addition to aligning the behavior in all cases and platforms is one of the priorities in one of the sections with such importance as accessibility.
Loading code snippet...
The concept ofΒ SemanticPropertiesΒ is added. Microsoft are talking about a series of properties that add extra information to Views to allow it to correctly interpret what happens when using the screen reader, or keyboard navigation.
Workload Installation
As part ofΒ .NETΒ unification, Microsoft have introduced the concept of SDK workloads to enable specific developer scenarios on top of the .NET SDK. In previous preview the underlying SDKs forΒ iOS,Β MacΒ Catalyst,Β macOS,Β AndroidΒ were enabled. Now they are introducing the maui, maui-desktop, maui-mobile and workloads. The first will acquire and install all the required SDKs for building .NET MAUI applications.
In the near futureΒ Visual Studio 2022Β will include these with its installer.
If you want use them, just open a CLI and check what you have installed π
dotnet sdk check

After verifying whatβs installed, you can see how the additional workloads are running π
Loading code snippet...

Finally to install .NET MAUI you need to execute π
Loading code snippet...
.NET MAUI New Features
Introducing .NET MAUI features: Controls, UI/UX designs, .NET MAUI toolkit with benchmarks and examples at the end.
.NET MAUI Controls
Ecosystem Controls
DevExpress, Syncfusion, and Telerik have all recently released new sets of controls for.NET MAUI that take use of Microsoftβs strong graphics capabilities. Maui.Graphics.

BlazorWebView
TheΒ newΒ BlazorWebViewΒ lets youΒ hostΒ a Blazor web applicationΒ directlyΒ in your application and take advantage of native platform functionality and user interface controls. The control can be added toΒ any XAML pageΒ and pointed to the root of the Blazor application (Itβs also often called Blazor Hybrid or Blazor Desktop).
Loading code snippet...
Slim processors
AlsoΒ .NET MAUIΒ will have a function toΒ migrateΒ a custom renderer fromΒ Xamarin.Forms.Β Although these can be used with some compatibility package,Β MicrosoftΒ claims that this will help the application to be much lighter and to develop it much more efficient.
Loading code snippet...
Single Project and Windows
Microsoft have made a few updates to single project based on developer feedback and Windows support to adopt the latest features.
- The NuGet package is replaced with theΒ .NET MAUI workloadΒ (
<UseMaui>true</UseMaui>
Β in the .csproj). - Single project solutions nowΒ nest individual platformsΒ within a βPlatformsβ folder for tidy organization.
- Updated to Windows App SDK 0.8.1 RC. UseΒ the latest Visual Studio 2022 compatible extensionΒ from the marketplace.

UX/UI .NET MAUI Featues
ImageButton
The ImageButton
view can combine a Button and an Image into one button. When someone clicks the ImageButton
, it does something different than if they click a Button. It has no idea of what is written on the text and how it is displayed, as opposed to the Button view.

WebView
WebView
renders any online or embedded HTML material using the platformβs native browser control; suitable for displaying markup that is more complicated than the subset of HTML supported by Label
.

BoxView
BoxView
is a basic rectangle with a given width, height, and color. It could be used for BoxView
decorating, basic graphics, and touch interaction with the user.

IndicatorView
The IndicatorView
is a control that shows indications in a CarrouselView
that reflect the number of items and the current position:

Shadows, corners, andΒ borders
Here we have Microsoft.Maui.Graphics
library, that offers an uniform UI drawing API based on native graphics engines, allowing us to quickly add borders, corner rendering, and gorgeous shadows to nearly anyΒ .NET MAUI layout or control.

Microsoft offers a new border
control. It may be used to provide borders and individual corner management on any layout or control. This functionality is accessible in WPF, UWP, Silverlight, and the most recent Windows App SDK templates.
In this example, we can see how is used a border check to wrap the counter label in order to round the top-left and bottom-right corners. This is an excellent choice for small business owners that are downsizing or wanting to create a more minimalist appearance on their new site.
Loading code snippet...
The specified shapeβs corner radius accepts a Thickness
type value, allowing separate control of each of the rectangleβs four corners: bottom-left, bottom-right, top-left and top-right.
The border
control can make your content wrap around. You can customize the background color and padding. There are more attributes that you can change, including:
- StrokeLineCap: is a form that appears at the end of a line.
- StrokeDashOffset: is the distance between the dots in the dash pattern.
- StrokeMiterLimit: set the miter length ratio to half of the stroke thickness.
- StrokeLineJoin: a type of vertices join.
- StrokeDashArray: a dash and gap pattern in the stroke.
Are you ready to give your user interface some depth? Any layout or control, including pictures and objects, can be given with Shadow
π
Loading code snippet...
This is the result:

Shared fonts, images, and app icons
Fonts and images can be placed in one location in your solution and .NET MAUI will enable them to natively work on all platforms you target. These are tracked in your *.csproj asΒ SharedImage
Β andΒ SharedFont
.
Loading code snippet...
Both accept wildcards to include all files within a location.
Loading code snippet...
Font Scaling
All controls across all platforms now have font scaling enabled by default. This means as your application users adjust their text scaling preferences in the OS, yourΒ UIΒ will reflect their choice. This produces a more accessible app by default.

Each control has an addedΒ FontAutoScalingEnabled
, and it even works withΒ FontImageSource
Β or your font icons. Setting aΒ FontSize
Β is your 100% size, and to lock it in youβll set:
FontAutoScalingEnabled = "false"
Β
Loading code snippet...
New Layouts
Microsoft also tells us that the layouts that have been used in theΒ .NET MAUIΒ are theΒ Xamarin.FormsΒ layouts. They say they started with that approach to quickly get the user interface on screen and focus on completing their library ofΒ UI 40Β controls.
At the same time, they have been creating streamlined layouts based on a new LayoutManager approach that employs its longΒ 7 yearsΒ of Xamarin.Forms design training to optimize consistency, performance, and maintainability.
One of the updates that you may have noticed is the leveling out of the default spacing values in these layouts:Β 0. If youβve used the legacy layouts, then you already know the different arbitrary values previously set there. Zero sets a clearer expectation and prompts you to set your preferred values that best suit your design needs.
A very easy way is π
Loading code snippet...
Native Alerts
Each platform has a native way of displaying alerts to users. These can be simple informational popups, simple input forms, and even action sheets with multiple options to guide a user.
These are available from any Page in a .NET MAUI application. π
Loading code snippet...

Clipping
When you need to mask content you can now add shapes to the clipping region of a layout or view. The most common use for this is to make a circle image.

Gestures
Gesture recognizers allow you to apply tap, pinch, pan, swipe, and drag-and-drop to any view instance. You can apply them easily inΒ XAML.
Loading code snippet...

Splash Screen
On mobile platforms especially you want your first screen to appear as quickly as possible, and this is done by implementing a static splash screen.Β .NET MAUIΒ now has a single place to describe your splash screen for all platforms that support them.
Loading code snippet...

New Control Handlers
They have introduced the first controls and properties that implement a new handler approach. These include partial implementations ofΒ Button, Label, and Entry, Slider, and Switch. They are now accepting pull requests to fill out complete implementations, and several contributors have already successfully contributed.
TheΒ HelloMaui sample applicationΒ now runs from a single project to macOS, iOS, and Android showcasing the current set of ported controls.
macOS

iOS

Android

Windows Control Styling (Fluent DesignΒ System)
Here, David OrtinauβββThe Principal Program Manager atΒ .NET MAUIβββtells us that they have added design changes, now with a more fluid interface and new controls and support for themes. The main updates are:

Multi-window Apps
Here is one of the most important and main features of this Preview. Now withΒ .NET MAUI you can add multiple windows. Simply with Application.Current.Windows
you can open a new window, because it contains the references of the created windows.
Letβs look at the Microsoft example:
Loading code snippet...

New Navigation inΒ .NET MAUIΒ (Shell)
What is this from Shell? Shell (also known as AppShell
) facilitates simple application designs, especially in tabs and drop-down menus.
Simply add the pages to your app and then arrange them as you like within the navigation structure. Letβs see how nice it looks:

To be honest, I think these new features are pretty cool.
Shell and Dependency Injection
In this new feature Microsoft tells us a bit about HostBuilder
. With this,Β .NET MAUI will have a powerful dependency injection. What Shell mainly offers is an incredible templating and styling capability to achieve in a very simple way our needs (or what we require at that moment).
To see it in a more practical way, letβs look at this example:
As Microsoft tells us, we must define dependencies in the DI container.
Loading code snippet...
And after that, we simply add in the page where we want the previously defined dependencies to be injected:
Loading code snippet...
Very simple, right? Letβs continue
Unification of libraries in .NET MAUI
AsΒ MicrosoftΒ tells us,Β .NET MAUIΒ will come with aΒ unificationΒ of critical libraries. You will provide several benefits by merging theΒ Xamarin.EssentialsΒ library into theΒ .NET MAUIΒ so that with these, you canΒ easilyΒ use the deviceβs capabilities such as device sensors, photos, contacts, and many services that you use on a regular basis, such as authentication and secure storage.
Mac Catalyst
You can add the following TargetFramework settings to your project to build for macOS desktop, usingΒ Mac Catalyst.
Loading code snippet...
.NET 6, C# 10 and Hot Reload
Templates and C#Β 10
I think the phrase with which Microsoft introduces this feature is perfect:
βSimplification is one of the main goals ofΒ .NET MAUIβ
To do this, they have added the templates using C# patterns, both file-scoped namespaces and implicit usings. Besides, they have added new element templates, with which we (the developers) will save a lot of work. Letβs see how it works (again I find the Microsoft example perfect):
Loading code snippet...
At this point you will think:
Where are the using statements?
Relax, donβt worryβββMicrosoft says that, not me. From now on, with this new update will be used to gather them dynamically.
.NET Hot Reload
.NET Hot ReloadΒ is a new feature, which according toΒ Microsoft, will allow you to make live edits to the source code of yourΒ application while it is running,Β reducingΒ the number of times you need to rebuild your application.
To start testing this feature install bothΒ .NET 6 Preview 4Β and Visual Studio 2019 version 16.11 Preview 1. Start your app through the Visual Studio debugger (F5) targeting a WinUI 3 host. Once your app is running, youβll now have the new option to make code changes and apply them using our newΒ βapply code changesβΒ button as illustrated below.

They also tell us that in the next releases .NET Hot ReloadΒ will also be available forΒ Android,Β iOSΒ andΒ macOS, and will also integrateΒ XAML Hot ReloadΒ andΒ Live Visual Tree.

.NET MAUI Performance with Benchmaks
Android QuickΒ Start
Ahead-of-time (AOT) compilation helps your Android application to code faster (high performance). If youβre trying to stay below the wifi installation bar, then full AOT may make your appβs artifacts larger than you want. Startup tracing is a solution in this case.
You can balance performance and space by only partially AOTβing the parts of your program that run at startup
The following are the results of device testing on the Pixel 5:

400ms benchmark
Here we can see an incredible increase in the performance made by Jonathan Peppers.
He found a systemic problem with Xamarin.Android class libraries:
- Include AndroidX & Google Material
- Include at least one
@(AndroidResource)
and use the ID from C# Resource.designer.cs
has 2,700+ fields
This problem compounds itself as you include more class libraries thatdepend on each other. The main app will end up repeatedly settingthese fields at startup for each library that contains fields inResource.designer.cs
β¦
Reviewing theΒ .NET MAUI fields, Jonathan Peppers found:
Loading code snippet...
He found 21,497 fields were set at startup for a dotnet new maui
app in Resource.designer.cs
To solve this problem, he came up with a new pattern.
He only copy the contents of Resource.designer.cs
and manually deleteall the fields we donβt need.
Results
Building a dotnet new maui
then dotnet build -c Release
andrunning on a Pixel 5.
Before:
- 21,497 fields set at startup in
UpdateIdValues()
- Activity Displayed: 1s454ms
- .apk size: 17300275 bytes
After:
- 65 fields set at startup in
UpdateIdValues()
- Activity Displayed: 1s079ms
- .apk size: 16677683 bytes
You can check the benchmark at GitHub
.NET MAUI RELEASE CANDIDATE Features
Microsoft is now officially releasing the .NET MAUI Release Candidates. All of them with new features and functionalities offering official support from Microsoft to the applications developed in .NET MAUI. Discover all the latest news!