Do you use .NET MAUI (was Xamarin)?

Last updated by Jack Pettit [SSW] about 1 month ago.See history

This rule has been archived

Xamarin has evolved beyond simply being an abstraction of the platform native APIs for iOS, Android, and UWP. It is now the .NET Multi-platform App UI (.NET MAUI).

Where previously you could write shared business logic in C# but needed to write your UI in either Xamarin.Android or Xamarin.iOS, now you can write cross-platform UI code in a single .NET MAUI project.

maui blazor mobile desktop web

Theoretically, it is possible to write your code only once and share 100% of the code you write across all target platforms - see Adam Cogan's blog post for a case study of achieving 96% code reuse.

xamarin platform bad
Figure: Bad example - Xamarin project targeting a single platform

It is possible to implement beautiful and complex UI designs in .NET MAUI, especially given the rich ecosystem of plugins and templates available (see rule: Do you know where to find the best Xamarin resources?). You can use drawing APIs like Microsoft.Maui.Graphics or the new .NET MAUI Community Toolkit.

single project good
Figure: Good example - Cross-platform .NET MAUI app targeting multiple platforms with a shared codebase

controls sample
Figure: .NET MAUI allows you to use C# and XAML to build your apps from a rich toolkit of more than 40 controls, layouts, and pages

We open source. Powered by GitHub