August 8th, 2023

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

David Ortinau
Principal Product Manager

.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!

Author

David Ortinau
Principal Product Manager

David is a Principal Product Manager for .NET at Microsoft, focused on .NET MAUI. A .NET developer since 2002, and versed in a range of programming languages, David has developed web, environmental, and mobile experiences for a wide variety of industries. After several successes with tech startups and running his own software company, David joined Microsoft to follow his passion: crafting tools that help developers create better app experiences. When not at a computer or with his family, David ...

More about author

43 comments

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

  • Vitalii Ganzha

    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

  • Daniel Ancines · Edited

    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?

  • Joseph Holman

    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....

    Read more
  • Alex N

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

  • rzechu

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

  • Ruslan Yakauleu

    Still better to use AvaloniaUI while no Linux support planned

  • John

    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...

    Read more
    • David OrtinauMicrosoft employee Author

      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...

      Read more
      • John

        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...

        Read more
  • Andrew Hanson · Edited

    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...

    Read more
    • David OrtinauMicrosoft employee Author

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

    • David OrtinauMicrosoft employee Author

      We recommend Azure pipelines and GitHub for .NET MAUI apps. Any roadmap information about App Center would come from that product team.

      • Peter Z

        Although I appreciate the reply, the only reason I'm posting here is because we have gotten complete silence from the App Center team for 1.5+ years at this point. See the github discussions I linked in my first comment. We can't even get the courtesy of "we won't support MAUI builds, use x, y and z instead."

        Although I am in the process of switching to github actions for my company's app, I am...

        Read more
  • Glaser, Thomas · Edited

    So, a stupid question, but why is it called Accelerator= and not just Shortcut= or something? Is it intentionally more generic to be used for more in the future?

      • Igor VelikorossovMicrosoft employee

        Microsoft's terminology is all over the place. Windows and Win32 use term "accelerators" but then define those through "shortcuts". In VS and Windows Forms parts of the docs shortcuts are referred to as "shortcuts" (e.g., here, here or here). And WPF uses "input gestures"....

        Apple uses "shortcuts" (e.g. here). So does Ubuntu (e.g., here).

        Read more