Announcing .NET MAUI in .NET 8 Preview 7: Keyboard Accelerators

David Ortinau

.NET MAUI is now available in .NET 8 Preview 7 introducing keyboard accelerators, and more fixes and improvements. This is the final preview release of .NET 8 before we ship release candidates and the generally available (GA) release. We will celebrate that release as usual at .NET Conf, and the dates have been announced. Join us November 14-16, 2023 to celebrate the .NET 8 release!

Version 7.0.92 is the latest service release for .NET 7. During this time we are heavily focused on .NET 8 to make it the best release. Starting next release with RC1 you will be covered with a go live support license. We encourage everyone to consider using .NET 8 releases from this point forward.

Today’s release is brought to you by 25 contributors (bots included). We want to celebrate them all, especially first time contributors Lehonti Ramos, webwarrior-ws, molesmoke, and Aaron Galuzzi. Well done! We appreciate everyone’s contributions. See our contribution guide if you are interested in helping out.

Desktop Keyboard Accelerators

Keyboard accelerators enable you to assign keyboard shortcuts to any menu item, whether visible or not, and attach them to any UI element. For example, this page has a window level menu to which you can add an accelerator with the MenuItem.Accelerator attached property:

<ContentPage.MenuBarItems>
    <MenuBarItem Text="File">
        <MenuFlyoutItem Text="Preferences"
            Command="{Binding PreferencesCommand}"
        />
    </MenuBarItem>
    <MenuBarItem Text="Products">
        <MenuFlyoutItem 
            x:Name="AddProductMenu"
            MenuItem.Accelerator="ctrl+a"
            Text="Add Product"
            Command="{Binding AddProductCommand}"
        />
        <MenuBarItem Text="Add Product Category"/>
    </MenuBarItem>
</ContentPage.MenuBarItems>

If instead of the attached property you want to express the accelerator in C#, then you can you can write:

MenuItem.SetAccelerator(AddProductMenu, Accelerator.FromString("ctrl+a"));

Now when those keys are triggered, the AddProductCommand fires just as if a user had tapped or clicked the menu item. See the Accelerator.FromString method for a list of supported modifiers.

What’s fixed and improved in .NET MAUI

The main focus of the release is on bug fixes and quality improvements. For a complete set of changes, review the 8.0.0-preview.7.8842 release notes. Here are the highlights:

  1. Memory Leak Resolutions:

    • Several memory leak issues were addressed in various UI controls, including Border, Editor, and Entry on different platforms, such as iOS, Android, and Windows. These fixes ensure improved memory management and application stability. #15946, #15614, #16045, #16101, #16348, #16349
  2. Enhanced UI Control Functionality:

    • UI controls like Border, WebView, and Entry received updates to their behavior, performance, and customization options on different platforms (iOS, Android, Windows). These enhancements contribute to a more user-friendly and feature-rich experience. #14740, #15881, #15585, #14846, #16215, #15458, #16270
  3. Platform-Specific Improvements:

    • Each major platform (iOS, Android, Windows) saw targeted improvements, ranging from memory leak fixes to performance enhancements, ensuring that the app runs smoothly and efficiently across diverse environments. #15734, #16145, #16032
  4. Bug Fixes and Refinements:

    • Several bugs, ranging from appearance issues (Shell TabBar) to functionality (SelectedItemChanged in ListView), were resolved across different platforms. These fixes contribute to a more polished and error-free application. #16128, #16241, #16275, #14663, #16057, #16116, #16174, #16248, #15099, #15459
  5. Input and Interaction Enhancements:

    • Improvements were made to user input and interaction features, such as cursor preservation in text boxes, menu key accelerators, and InputTransparent behavior permutations. These updates enhance user engagement and application usability. #15799, #15835

Additional release notes:

How to update

Visual Studio 2022 on Windows now includes .NET 8 previews and the .NET MAUI preview workload. Download the latest preview version (17.8 Preview 1), select the .NET Multi-platform App UI workload, and then check the optional component “.NET MAUI (.NET 8 Preview)”.

There is a known issue on Mac building for Apple platforms when you have both .NET 8 Preview 6 and 7 installed. Please review the known issues for details and steps to resolve.

If you are on macOS, you can now develop using Visual Studio for Mac after enabling the preview feature for .NET 8 in Preferences and installing .NET 8 Preview 7 from the installer.

Enable .NET 8 in Visual Studio 2022 for Mac

Download the .NET 8 Preview 7 installer, and then install .NET MAUI from the command line:

dotnet workload install maui

What’s Next

We are preparing to introduce Xcode 15 support in the next .NET 8 release for the new versions of iOS, iPadOS, macOS, Mac Catalyst, tvOS, and CarPlay. From that point forward .NET 8 will use Xcode 15 which we anticipate to be the stable Xcode at the time .NET 8 ships in November.

Developer tip: I recommend managing your Xcode versions by explicitly downloading and selecting versions from the Apple developer portal, rather than relying on the App Store which may auto-update and break your compatibility. When maintaining side-by-side versions of Xcode you may want to use something like Xcodes.app.

Feedback Welcome

We appreciate your feedback and contributions to .NET MAUI. You can report issues, suggest features, or submit pull requests on our GitHub repository. You can also join our Discord server.

Thank you for your support and happy coding!

43 comments

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

  • Andrew Hanson 3

    While many people say about bugs in MAUI, and I agree that they exist, I should say that it helped me create a PRODUCTION-READY application, save a lot of time for learning new frameworks and reuse existing program modules. Yes, sometimes you may stumble upon layout/visual issues, but usually, it’s not difficult to find a workaround.

    It’s also great to see that the community is evolving, Xamarin community projects are migrated to .NET MAUI, and toolkits are enhanced. We already use MAUI for SEVERAL PROJECTS, and I believe the platform will get even better soon and give us even more benefits.

    Thank you!

    • David OrtinauMicrosoft employee 0

      That’s great to hear Andrew, thanks for sharing!

  • John 0

    Im interested in trying .NET 8, but the Upgrade Assistant fails to upgrade some projects. It can handle:
    net7.0
    But can’t handle more complex:
    net7.0-android;net7.0-ios;net7.0-maccatalyst
    $(TargetFrameworks);net7.0-windows10.0.19041

    I have gone through all 19 projects in our Maui test solution to do it manually, but clearly missed something as I had a number of issues and couldn’t get it to build without investing significant time to resolve, when really I just want to see all the bug fixes that were denied from .net 7.

    Is the upgrade process going to be more refined once you go to RC?

    • David OrtinauMicrosoft employee 0

      The .NET Upgrade Assistant is for moving projects from Xamarin to .NET MAUI. We may enhance it in the future to move from .NET 7 to 8 and so on, however that’s not something we’ve invested in. Anything UA does today for that is not .NET MAUI specific.

      You can compare .NET 7 to .NET 8 changes with GitHub. Roughly 20% of fixes were backported to .NET 7.

      net7->net8 is the main change. There are new explicit package references you can add in net8 to pin to a specific build however it’s not required. I’m curious what issues you had otherwise; we definitely want to smooth that out. Please open an issue on GitHub or shoot me an email david.ortinau@microsoft.com.

      • John 0

        Ok understood, I didn’t realise UA wasn’t meant for upgrading from .NET 7 to 8. In the end I just created .NET 8 projects and copied files across, all seems to be working nicely, then I upgraded our ADO build pipeline to install .NET8 + Maui and we are deploying iOS release builds now. Haven’t tried Android but that should be simple enough.

        Not seeing any notable speed improvements over .NET 7, or any improvements to the stability of hot code reload. But we are now in a good position to start looking at migrating our production XF apps in November to identify any blockers or issues.

        Still, it is a very narrow window between now and 1st May 2024. Has there been any discussion about extending the life of XF a little longer to lower the burden of migration? MS are putting a lot of companies in a very, very difficult position.

  • Ruslan Yakauleu 0

    Still better to use AvaloniaUI while no Linux support planned

  • rzechu 0

    Azure Pipelines + (free!) Selfhosted Linux Agent + MAUI = failed

  • Alex N 0

    why not just to integrate web engine / and use html to build ui

  • Joseph Holman 0

    I’m disappointed to see things like CollectionView being effectively completely broken (16787 – this one completely breaks our app to the point it’s entirely unusable) along with basic things like Border (17109) – considering .NET 8 is supposed to be quality-focused I’m stunned how regressions like this can get through, particularly the latter which is incredibly frustrating because it isn’t even niche and seems to demonstrate a lack of even the most basic of testing. It’s scary to think the next drop will be an RC.

  • Daniel Ancines 1

    Hi David, how you doing?

    I’m trying to use Accelerators following your example, but I’m getting the message of an obsolete implementation, did you guys changed something at RC1 release?

  • Vitalii Ganzha 1

    How can I upgrade existing MAUI application to the latest version? I installed SDK 8.0.100-rc.1 but I’m not sure how to use it. VS 2022 allows me to use only .net 6 and 7

Feedback usabilla icon