.NET MAUI Release Candidate – Ready for cross-platform app development

David Ortinau

Today we are excited to announce the availability of .NET Multi-platform App UI (.NET MAUI) Release Candidate. The SDK is now API complete, ready for libraries to update and make ready for GA (general availability) compatibility. As with other .NET release candidates, this release is covered by a “go live” support policy, meaning .NET MAUI is supported by Microsoft for your production apps.

Image dotnet podcasts

Get Started Today

To acquire .NET MAUI RC1, install or update Visual Studio 2022 Preview to version 17.2 Preview 3. In the installer confirm .NET MAUI (preview) is checked under the “Mobile Development with .NET workload”.

To use .NET MAUI RC1 on Mac, follow the command line instructions on the wiki. Support for .NET MAUI in Visual Studio 2022 for Mac will ship formally in a future preview.

Release Candidate release notes are on GitHub. For additional information about getting started with .NET MAUI, refer to our documentation, and the migration tip sheet for a list of changes to adopt when upgrading projects.

Jump start your journey with the .NET Podcasts app (pictured above) which runs on Android, iOS, macOS, and Windows, and showcases both native app UI as well as Blazor Hybrid. Looking for a full workshop on how to get started with .NET MAUI? We have you covered with our newly released .NET MAUI workshop where you will build an app from start to finish and integrate native features.

What about Xamarin support? The Xamarin Support Policy is still in effect which covers those products for 2 years after initial release. The last release was November of 2021, and so support will continue through November 2023.

What’s in the .NET MAUI release candidate?

As a multi-platform app building framework, .NET MAUI leverages platform SDKs for Android, iOS, macOS, and Windows. These foundational pieces are included in this release, and you can use them directly with C# in addition to maximizing your code sharing and productivity with .NET MAUI.

base theme for all controls

.NET MAUI ships with 40+ layouts and controls optimized for building adaptive UIs across both desktop and mobile platforms. You can also incorporate Blazor components or entire Blazor applications to distribute the same experiences on desktop and mobile as you may today on web.

How does this compare to Xamarin.Forms? You get every UI control that ships with Xamarin.Forms, plus new controls such as BlazorWebView, Border, GraphicsView, MenuBar, Shadow, and Window.

Layouts CarouselView Line Stepper
AbsoluteLayout Checkbox ListView SwipeView
BindableLayout CollectionView Path Switch
FlexLayout ContentView Picker TableView
GridLayout DatePicker Polygon TimePicker
HorizontalStackLayout Editor Polyline WebView
StackLayout Ellipse ProgressBar Pages
VerticalStackLayout Entry RadioButton ContentPage
Views Frame Rectangle FlyoutPage
ActivityIndicator GraphicsView RefreshView NavigationPage
BlazorWebView Image RoundRectangle TabbedPage
Border ImageButton ScrollView Shell
BoxView IndicatorView SearchBar
Button Label Slider

These are all documented in addition to related topics such as:

The new .NET MAUI project template now includes a default stylesheet in “Resourcesstyles.xaml” with a color palette and styling for all the controls. Take for example the Entry. When starting a new application these text inputs will now begin with a shared theme while still being true to the platform on which it runs.

<Style TargetType="Entry">
    <Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}" />
    <Setter Property="FontFamily" Value="OpenSansRegular"/>
    <Setter Property="FontSize" Value="14" />
    <Setter Property="PlaceholderColor" Value="{AppThemeBinding Light={StaticResource LightGray}, Dark={StaticResource DarkGray}}" />
    <Setter Property="VisualStateManager.VisualStateGroups">
        <VisualStateGroupList>
            <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal">
                    <VisualState.Setters>
                        <Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}" />
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="Disabled">
                    <VisualState.Setters>
                        <Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource LightGray}, Dark={StaticResource DarkGray}}" />
                    </VisualState.Setters>
                </VisualState>
            </VisualStateGroup>
        </VisualStateGroupList>
    </Setter>
</Style>

For views that support different states we’ve created a sensible default, and provided light and dark mode color options. For more information check out:

Customizing Controls

One of the things .NET MAUI does to improve upon the Xamarin.Forms architecture is adding low-code hooks to modify just about anything. Let’s consider the canonical example of removing the distinctive Android underline on an Entry field. How might you go about doing this when there is no multi-platform style for “underline” because it only exists on Android?

#if ANDROID
Microsoft.Maui.Handlers.EntryHandler.Mapper.ModifyMapping("NoUnderline", (h, v) =>
{
    h.PlatformView.BackgroundTintList = ColorStateList.ValueOf(Colors.Transparent.ToPlatform());
});
#endif

That’s all the code there is. This code just needs to run somewhere in the start of your application before the handler is called.

Let’s explain what is going on here. Firstly, the #if ANDROID is a conditional compilation directive that indicates this code should only run for Android. In other cases where you are modifying the control for ALL platforms, this isn’t necessary.

Next, we need need access to the control. The Entry you use is a .NET MAUI control. Each property, command, event, etc. of the Entry is “mapped” by a “handler” to a platform implementation. To modify a mapping you can tap into it via the handler’s map such as Microsoft.Maui.Handlers.EntryHandler.Mapper. From the mapper we have 3 methods:

  • PrependToMapping which runs before the .NET MAUI code
  • ModifyMapping which runs instead of the .NET MAUI code
  • AppendToMapping which runs after the .NET MAUI code

For this case it doesn’t matter which one we use, as it will be called at least once, and no other implementation on the Entry will touch the native properties we need to modify. Here the coded uses ModifyMapping and adds an entry called “NoUnderline”. Typically the property matches the name of an actual property, however in this case we are introducing a new one.

The h in the action is the handler which gives us access to the PlatformView which in this case is of Android type TextView. At this point the code is working directly with the Android SDK.

With the underline now out of the way, you can implement your own design of, say, a bordering box like old-school Windows Phone.

border around an entry view

<Border Stroke="{StaticResource Black}"
        StrokeThickness="2"
        StrokeShape="Rectangle">
    <Entry
        Margin="20,4"
        Placeholder="Username" />
</Border>

For more examples on how you can easily modify the look and feel of controls at the cross-platform as well as platform specific layers, check out the documentation for customizing controls.

We need your feedback

Install the latest preview of Visual Studio 2022 for Windows (17.2 Preview 3) following our simple guide and build your first multi-platform application today.

We’d love to hear from you! As you encounter any issues, file a report on GitHub at dotnet/maui.

73 comments

Discussion is closed. Login to edit/delete existing comments.

  • Jerzy Piechowiak 0

    Any plans for watchOS support?

    • David OrtinauMicrosoft employee 0

      We have no immediate plans to support watchOS. Follow future roadmap work here: http://themesof.net/

  • chickenedFry 0

    I’m new to the .NET. How long it usually takes from RC to release?

    • David OrtinauMicrosoft employee 0

      It depends, of course. Our target is to ship the GA (general availability) release in May.

  • Claudiu Alex 0

    Does Visual Studio for Mac 2022 Preview 9 include support for .Net MAUI RC ?

    • David OrtinauMicrosoft employee 0

      My answer is “no, it’s not supported”, because we have not validated and signed off on the .NET MAUI scenarios in that release. Some things may work for you in part because many things are shared with Xamarin: those scenarios are being validated.

    • CK Yung 0

      Could i advise “Visual Studio Toolbox Live – What’s New in Visual Studio for Mac: Release Candidate!” which will be lived at May 4, 2022 22:30 UTC.
      https://www.youtube.com/watch?v=HBhtURuY2bw

  • Hakeem Oriola 0

    Is this available on Visual studio for Mac 2022?

    • John 0

      The 2nd paragraph from the post covers this.

  • John 0

    Hi David, I see that hot code reload still broken and has been since preview 12.
    Tested on Windows and iOS with new Maui projects.

    Easy to replicate, create a new solution, run it with a Windows target. Edit the code behind OnCounterClicked method to put something else in the label. Trigger hot code reload (I usually enable reload on save).

    • David OrtinauMicrosoft employee 0

      Yes, that’s a known VS issue. It’s being worked on.

      • John 0

        Thanks David.
        Do you know if we are going to have a faster cadence of releases now that we are in RC? There are still a lot of layout bugs and issues that haven’t yet been addressed. It would be better to fix most of those before declaring GA, otherwise, the formal release will be regarded as worse than the first XF release. Need to start on the right foot so to speak.
        We want Maui to succeed, but when it goes GA (and to a lesser extent RC) you will get a lot more people trying it for the first time who could then have a very tainted view.

  • David Beavon 0

    Thanks for the hard work. I’m very eager to start targeting android and WINUI.

    Hopefully this ecosystem will soon have some advanced controls for desktop applications (eg. outlook bar, ribbon, data grids).
    In any new UI platform, those are important ingredients that encourage developers to start making a switch. These things took forever to arrive on UWP (ie. many years).

    Validation support via MVVM is pretty important too (INotifyDataErrorInfo). I just love the WPF adorner layer for validation feedback. Not sure why this is always such a low priority (… thinking of WINUI … ) since it is a requirement in just about every application, and nobody should have to implement it all from scratch.

  • rajesh kumar 0

    Hi
    Thank you very much providing .net MAUI platform to built multi target platform app. Its really solved lot of problem.
    When I am publishing Window App in .net MAUI .getting below error.
    Manifest file at ‘obj\Release\net6.0-ios\staticwebassets.build.json’ not found.
    Any solution for it?

  • Manuele Lucchi 0

    Since the new preview of net 7 introduces NativeAOT, is there any plan to support it in Maui? Or at least having a page that highlights the current trimming support status

  • Jan Albicker 0

    Since the release icons can’t be displayed with the android emulator. Can’t even click on a simple entry. What’s going on?

Feedback usabilla icon