Overview of MAUI

Learn about .NET MAUI and how it enables cross-platform native application development.

.NET MAUI stands for .NET Multi-platform App UI. It's a framework based on .NET. It can run on top of .NET versions 6 and above. Its primary purpose is to allow developers to build a desktop or mobile application for Windows, macOS, Android, and iOS from the same code base.

Press + to interact
.NET MAUI using a shared codebase
.NET MAUI using a shared codebase

.NET MAUI is an open-source framework. It's an evolution of another .NET-based, cross-platform mobile application development framework known as Xamarin.Forms. However, MAUI isn't merely a new version of Xamarin.Forms. It has some significant differences.

What can .NET MAUI do?

MAUI is a fully comprehensive platform for developing desktop and mobile applications. It can be used for the end-to-end development process without having to rely on any other framework. Of course, various frameworks and libraries can be used for adding new capabilities to MAUI. For example, there are third-party libraries that add Linux as the build target for MAUI applications. But other than this, MAUI is sufficient for building a fully functioning native application.

With .NET MAUI, you can do the following:

  • Perform development on any platform that supports .NET, which includes Windows, macOS, and Linux.

  • Compile Windows, macOS, Android, or iOS applications from the same codebase.

  • Share UI layouts between different platforms and different applications.

  • Apply platform-specific styling to the application.

  • Apply any platform-specific business logic, if required.

  • Select from a wide range of visual controls or create your own.

  • Draw elaborate graphics without having to know how the underlying video hardware works.

  • Access platform-specific functionality, such as device sensors.

How .NET MAUI works

MAUI codebase uses the standard .NET SDK, so the bulk of the code works exactly the same way regardless of what operating system it's being written on and what integrated development environment (IDE) or code editor is being used. The bulk of the code will be standard C# code that works with any standard C# tools, such as code highlighter, IntelliSense, etc.

But there are also some platform-specific libraries that abstract away the interaction between .NET application programming interfaces (APIs) and drivers of specific device types. So, essentially, the programming experience largely remains the same until we target a specific platform to build the application for.

Different platforms compile applications differently. This is what the process is for all supported platform types:

  • If the target is Windows, the application is compiled into a native Windows UI 3 executable.

  • If the target is Android, the application is first compiled into an intermediate language (IL) executable, which is then compiled into the native machine code when the application launches on the device by using the just-in-time (JIT) compiler.

  • If the target is iOS, the application is compiled into a native iOS app.

  • If the target is macOS, the application is built into a Mac Catalyst app, which is used by macOS to run iOS applications and augment them with macOS-specific APIs.

XAML, the markup language used for building user interfaces in MAUI apps, tells the compiler what the interface should look like but doesn't tell it how to make it. The platform-specific tools create the user interface based on the APIs of a particular platform.

.NET MAUI is different from Xamarin.Forms

Although .NET MAUI is an evolution of Xamarin.Forms, there are many fundamental differences between the two frameworks. The most fundamental differences can be summarized as follows:

  • Xamarin.Forms is only used for building mobile applications, while MAUI can build desktop applications as well as mobile apps.

  • MAUI uses the standard .NET SDK–style project format, while Xamarin.Forms uses the old .NET Framework–style project format, which is much more verbose and difficult to work with.

  • Xamarin.Forms applications consist of multiple platform-specific projects that share a common library with the core business logic, while MAUI can use a single project and target it to be built for multiple platforms.

  • Even though both MAUI and Xamarin.Forms use XAML to define UI markup, the names of the elements are different.

.NET MAUI vs. Xamarin.Forms

Parameters

.NET MAUI

Xamarin.Forms

Renderers

Loosely coupled

Tightly coupled to BindableObject

App Models

MVVM, RxUI, MVU, Blazor

MVVM, RxUI

Single Project Support

Yes

No

Multi-targeting

Yes

No

Multi-window

Yes

No

Note: We'll cover the process of migrating from Xamarin.Forms to MAUI. This will allow Xamarin.Forms developers to transition into MAUI development as smoothly as possible.