Questions tagged [maui]

.NET Multi-platform App UI (MAUI) lets you build native apps using a .NET cross-platform UI toolkit that targets the mobile and desktop form factors on Android, iOS, macOS, Windows, and Tizen. .NET MAUI is the successor of Xamarin.Forms and is now part of the .NET ecosystem, rather than a separate library.

.NET Multi-platform App UI (MAUI)

.NET MAUI is:

  • Multi-platform native UI
  • Deploy to multiple devices across mobile & desktop on Android, iOS, macOS, Windows and Tizen.
  • Using a single project, single codebase
  • Evolution of Xamarin.Forms

Goals

  • Improve app performance
  • Improve simplicity of control extensibility
  • Improve simplicity of contributing
  • Enable developer options to use Model-View-Update (MVU) and Blazor

Xamarin.Forms vs .NET MAUI

Xamarin.Forms .NET MAUI
Platforms
Android API 19+ API 21+
iOS 9-15 10+
Linux Community Community
macOS Community Microsoft
Tizen Samsung Samsung
Windows UWP Microsoft
WPF Community
Microsoft
Features
Renderers Tightly coupled to BindableObject Loosely coupled, no Xamarin.Forms dependencies
App Models MVVM MVVM
RxUI RxUI
MVU *
Blazor *
Single Project No Yes
Multi-targeting No Yes
Multi-window No Yes
Misc
.NET Xamarin.iOS, Xamarin.Android, Mono, .NET Framework, ... .NET 6+
XAML Hot Reload Experimental: SDK 4.x & Visual Studio 2019 prior to version 16.9
Feature Complete: SDK 5.x & Visual Studio 2019 version 16.9 or newer
Yes
.NET Hot Reload iOS/Android – No
UWP – Limited support for runtime edits using .NET “Edit & Continue”
Yes
Acquisition NuGet & Visual Studio Installer dotnet
Project System Franken-proj SDK Style
dotnet CLI No Yes
Tools
Visual Studio 2019 Yes Yes
Visual Studio 2019 for Mac Yes Yes
Visual Studio Code No Experimental**

* These app models are experimental.

** Visual Studio Code will work by virtue of .NET unification, however not all experiences that make .NET MAUI development delightful (intellisense for example) may be enabled at the time of .NET 6 release.

FAQs

Do you have questions? Do not worry, we have prepared a complete FAQ answering the most common questions.

How to Engage, Contribute, and Give Feedback

Some of the best ways to contribute are to try things out, file issues, join in design conversations, and make pull-requests. Proposals for changes specific to MAUI can be found too.

4576 questions
7
votes
2 answers

.NET Maui: Vector/SVG splashscreen not correctly resized

Testing to add a custom splash screen for a Maui app, I read some Microsoft docs that says At build time, the splash screen image is resized to the correct size for the target platform and device. The resized splash screen is then added to your…
Ted
  • 19,727
  • 35
  • 96
  • 154
7
votes
6 answers

MAUI: What build action for appsettings.json and how to access the file on Android?

I created an appsettings file for a MAUI app and loading it in the IConfiguration using .Host.ConfigureAppConfiguration on the builder from a MauiApp.CreateBuilder(); I can access the file in Windows but not when running the Android emulator. The…
Dollar Bread
  • 143
  • 1
  • 2
  • 7
7
votes
3 answers

Catch and display on the page any error in a .NET Maui Blazor project

For testing purpose, I would like to 'catch' any error occuring in my app and displaying it on the page (not in the console). For that purpose I discovered the ErrorBoundary component in the .Net 6 framework. ErrorBoundaries doc from Microsoft At…
Bronzato
  • 9,438
  • 29
  • 120
  • 212
7
votes
1 answer

.NET MAUI Xaml inside BlazorWebView

I am building my App completely with Blazor. Everything happens inside my BlazorWebView. Is it possible to use things like RefreshView inside a .razor file? I know I can instantiate a ContentView from code behind but can I implement it into the…
7
votes
2 answers

Problem installing Android workload for MAUI Visual Studio 2022

I have installed Visual Studio 2022 Preview 4.1 according to these instructions: https://learn.microsoft.com/en-us/dotnet/maui/get-started/installation. I started a new CometApp project and I get the following error: NU1012 Platform version is not…
Bjørn Hellesylt
  • 805
  • 2
  • 7
  • 10
7
votes
2 answers

What will happen to custom controls and Renderers in .net maui?

In my Current Xamarin.Forms projects I have created many Renderers for different requirements. Now in September maui is coming and we have to migrate our projects to that. So in that what will happen to Renderers? Is it going to work as it is or we…
Divyesh
  • 2,085
  • 20
  • 35
7
votes
5 answers

MAUI project, cannot add a new Page

I'm trying out MAUI and I've ran into a weird bug. It won't let me add a new Page, every time i try to do so the InitializeComponent in the constructor gives me an error : The name 'InitializeComponent' does not exist in the current context I've…
CodeBuddyBenny
  • 195
  • 1
  • 3
  • 10
7
votes
5 answers

Creating first .Net MAUI project

I tried to create Maui project in windows using visual studio developer command prompt using Command : dotnet new maui But Its not creating Maui project,Getting Error message No templates found matching : maui I installed the .Net 5 and visual…
Pradeep Kumar
  • 109
  • 1
  • 10
6
votes
1 answer

.NET MAUI Navigation animation

If I want to animate the transition from one page to another in MAUI I need to activate it with true value: await Shell.Current.GoToAsync($"//{nameof(DashboardPage)}", true); And this animates the page transition from Right to Left. Is there a way…
user117911
  • 79
  • 1
  • 6
6
votes
2 answers

MAUI; cannot access colors from resources in code

I am trying to access colors from my colors file (under styles) in my maui application: #7DD2CD #a4dbda #c3e1ed If I wanna access the…
inno
  • 376
  • 2
  • 15
6
votes
1 answer

Why does Microsoft have both Avalonia UI and .NET MAUI?

.Net Conf is currently underway and I learnt about something called Avalonia UI. (I use .NET MAUI) After doing some research, Avalonia UI was primarily a desktop UI framework that now supports Android and iOS. Since they're both dotNet foundation…
Tanaka Mawere
  • 683
  • 1
  • 9
  • 22
6
votes
1 answer

Wrap an existing Blazor Web Assembly app into a .NET MAUI Hybrid App

I watched this tutorial on how to create a .NET MAUI Blazor App https://www.youtube.com/watch?v=bnoCU5XGBh4 However I have an existing Blazor Web Assembly app, what is the best recommended way to wrap it into a BlazorWebView? I have dug around for…
User101
  • 748
  • 2
  • 10
  • 29
6
votes
2 answers

Set focus to Entry control to trigger keyboard in .NET MAUI app

I'm trying to set focus to an Entry control when a page loads to automatically trigger the keyboard. However, while the Entry control receives focus (caret blinking) if done during Loaded event, the keyboard doesn't appear. If done only in the…
Ted Nyberg
  • 7,001
  • 7
  • 41
  • 72
6
votes
2 answers

.NET MAUI Transparent Status Bar

How do I make the status bar transparent and show the content behind it on Android using .NET MAUI? I've seen this post, is there a way to recreate this using C#? Similar to Google Maps:
DanFlakes
  • 55
  • 1
  • 7
6
votes
2 answers

How to create an Android foreground service in MAUI

I'm trying to create a foreground service in MAUI (using .NET 6) for an Android app, but currently, there are no tutorials (that I could find) on achieving this. What would be the best starting point to add a foreground service or how would you…
bluscience
  • 223
  • 3
  • 7