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
9
votes
3 answers

Hot reload does not work with .NET MAUI starter project

I'm using Visual Studio 2022 (17.2 Preview 4) to use .NET MAUI for windows. When trying to hot reload with the default project it gives the error "Hot reload can't automatically apply your changes. The app needs to be rebuilt to apply updates." I'm…
Selim Sandal
  • 101
  • 1
  • 6
9
votes
5 answers

"Trust anchor for certification path not found." in a .NET Maui Project trying to contact a local .NET WebApi

I'm new to mobile development and I'm trying to have my .NET Maui app connect to a local ASP.NET Core website (API). I am currently blocked by this exception: System.Net.WebException: 'java.security.cert.CertPathValidatorException: Trust anchor for…
Marc
  • 91
  • 1
  • 3
9
votes
3 answers

How to Create DataGrid with .NET MAUI Preview 7?

I'm working with a .NET MAUI Preview 7 project and I need to create a Table/Datagrid but I see that in the XAML file, there is no tag for "Table","DataGrid" or "DataView". I found only "Grid" which is used to divide the form in rows and…
8
votes
2 answers

.NET MAUI - How to place a button in the TitleBar?

In my .NET MAUI project, I want to place a button inside the TitleBar right there: The TitleBar itself is generated automatically by setting the Title of the ContentPage. Does anyone know how to place a button right there?
Florian
  • 1,019
  • 6
  • 22
8
votes
1 answer

How to create reusable Components in .NET MAUI?

I have just recently started using .Net MAUI. But now I'm wondering how to use a piece of code, e.g. a self-made navigation bar on all my pages, because it doesn't make sense to write the same code on all 10 pages. I like to know if there is a way…
eXor420
  • 139
  • 1
  • 5
8
votes
1 answer

What's the difference between a MAUI class library and a normal class library?

As far as I can tell a MAUI Class Library is a class library in .NET 6, where you can inject platform specific code. But is there really any other difference between a MAUI library and a .NET 6 library? Are they interchangeable if you leave out the…
8
votes
2 answers

.Net Maui MVVM - What is the best approach to populating a CollectionView upon a Page/View opening?

I'm new to .Net Maui but have completed James Montemagno's 4 hour Workshop. Included in the Workshop was: Creating a Page with a CollectionView Creating a ViewModel Creating an async method which calls a data service to retrieve data Configuring…
Todd T
  • 185
  • 2
  • 9
8
votes
4 answers

how to play an audio file - .NET MAUI

I want to play a sound on my mobile application (android and IOS) I play a sound in certain circumstances. How can I do it?
Emma
  • 431
  • 6
  • 19
8
votes
0 answers

.NET Maui Project Template Errors - The type or namespace name 'Android' could not be found

I'm trying to start a new .net Maui project. I have added no code whatsoever to the starting project template. Microsoft Visual Studio Community 2022 (64-bit) Preview Version 17.2.0 Preview 5.0 .NET Framework 4.7.2 Steps to reproduce: Choose New…
drasticp
  • 287
  • 3
  • 10
8
votes
2 answers

.Net MAUI - AppShell navigation & dependency injection

I'm playing around with .Net Maui, AppShell and dependency injection. I try to call a page with a constructor which takes the ViewModel of this page as parameter. The constructor looks like this: public AuthenticationPage(AuthenticationViewModel…
Phil
  • 462
  • 6
  • 13
8
votes
3 answers

MAUI - push notifications support

I couldn't find any documentation of how to implement push notifications in maui. Maybe somebody was able to integrate xamarin library in maui project to accomplish it?
Lanayx
  • 2,731
  • 1
  • 23
  • 35
8
votes
2 answers

MAUI project, cannot navigate to a new page

I've ran into a bug in MAUI and I just wanted to know if I'm the only one or if I'm doing something wrong in this new environment :) Before I've always been able to do this when navigating to a new page via a button click: private async void…
CodeBuddyBenny
  • 195
  • 1
  • 3
  • 10
7
votes
1 answer

For Dotnet Maui, what the difference between Application.Current?.Dispatcher.Dispatch(async()) and MainThread.InvokeOnMainThreadAsync

Title says it all, docs don't seem to say which should be preferred. They have the same arguments you can pass basically…
ShadyHippo
  • 71
  • 2
  • 3
7
votes
2 answers

Specify the color of a SVG image in .NET Maui

.NET MAUI has the ability to use SVG images which is really nice, but I haven't been able to set the color of the SVG image. The official docs state I could use the TintColor in the project file but that's not a good solution as I want to be able to…
Jasper
  • 545
  • 7
  • 18
7
votes
3 answers

How to resize Splash Screen Image in MAUI?

I'm trying to add an image on Splash Screen and the image size is 512x512 but it is not showing correctly on the splash screen. So, is there a way to resize the splash screen image?