Microsoft Releases .NET MAUI Preview 6

.NET MAUI is now shipped as a workload installation. A bunch of new capabilities including gestures, modal pages, view clipping, native alerts, flex layout, and more are now available.

Recently, Microsoft announced the release of .NET 6 Preview 6, which is the second to last preview before .NET 6 enter the RC period. 

Starting with .NET 6 Preview 6, Microsoft has tested and support Visual Studio 2022 Preview 2. VS 2022 enables users to leverage the Visual Studio tools developed for .NET 6 like development in .NET MAUI, new Web Live Preview for WebForms, Hot Reload for C# apps, and other performance improvements in their IDE experience.

With .NET 6 Preview 6 the company is shipping its latest progress on .NET Multi-platform App UI (MAUI). .NET MAUI is now being shipped as a workload installation. A bunch of new capabilities including gestures, modal pages, view clipping, native alerts, flex layout, and more are now available. Also, single project also continues to be improved along with adopting the newest release of the Windows App SDK and Visual Studio extensions.

Well, as part of .NET unification Microsoft introduced the concept of SDK workloads to enable specific developer scenarios on top of the .NET SDK.  The way in preview 4 the underlying SDKs for Android, iOS, macOS, and Mac Catalyst were enabled, in preview 6 the company is introducing the maui, maui-mobile, and maui-desktop workloads. maui acquires and installs all the required SDKs for building .NET MAUI applications. However, if you are only wanting to target mobile or desktop, you can choose maui-mobile or maui-desktop.

New .NET MAUI capability Gesture recognizers enables users to apply tap, pinch, swipe, pan, and drag-and-drop to any view instance. It is easy to apply them in XAML as below:

<Grid>
    <Grid.GestureRecognizers>
        <TapGestureRecognizer NumberOfTapsRequired="2" Command="{Binding OnTileTapped}" />
    </Grid.GestureRecognizers>
    <!-- Grid content -->
</Grid>

 

Source: Microsoft

In the above example, if you double-tap the weather widget tile, it simulates a refresh with a fade-out, fade-in animation.

If you want to mask content you can now add shapes to the clipping region of a layout. The most common use for Clipping is to make a circle image.

Source: Microsoft

Native Alerts is a new feature that helps each platform to have a native way of displaying alerts to users. Developers can use simple informational popups, simple input forms, and even action sheets with multiple options to guide a user.

The .NET team has also made a few updates to single project based on developer feedback. The NuGet package is substituted with the .NET MAUI workload. Single project solutions now nest individual platforms within a “Platforms” folder for tidy organization.

For additional details, you can visit the official announcement here.



Next Recommended Reading .NET 5.0 Preview 2 Released