Microsft Brings MAUI Compatibility For Xamarin Community Toolkit

The company has released two new .NET MAUI-compatible versions of the Xamarin Community Toolkit.

Recently, Xamarin Community Toolkit team announced two new .NET MAUI-compatible versions of the toolkit: Xamarin.CommunityToolkit.MauiCompat, and Xamarin.CommunityToolkit.Markup.MauiCompat

Microsft said that these MauiCompat libraries align to recent release of Xamarin.CommunityToolkit; the basic difference is that these are meant for .NET MAUI apps, while Xamarin.CommunityToolkit is meant for Xamrain.Forms apps.

This MauiCompat release includes support for iOS and Android. While the future MauiCompat releases will include support for macOS and UWP as well.

In order to migrate your existing Xamarin.Forms app to .NET MAUI, you can leverage these MauiCompat libraries. They accommodate the same logic as their Xamarin.CommunityToolkit counterpart, targeting .NET MAUI in lieu of Xamarin.Forms. Microsoft recommends finally replacing Xamarin.CommunityToolkit.MauiCompat with the new .NET MAUI Toolkit, CommunityToolkit.Maui, to take advantage of new features and optimizations.

Source: Microsoft

For new.NET MAUI apps, users are advised to make use of the new .NET MAUI Community Toolkit, as that is fully optimized for .NET MAUI, instead of Xamarin.CommunityToolkit.MauiCompat.

Both these new MauiCompat libraries are available as a NuGet package that can be added to any .NET 6 project targeting net6.0-ios and net6.0-android.

Well, this package is being built alongside the preview of .NET MAUI, and there are still some things that need to be etched out on both sides. Microsoft is releasing this now to ensure that the MauiCompat Toolkit is ready to use by the time .NET MAUI is released.

For the future, the team said that it has planned to release a MauiCompat NuGet package alongside each new release of Xamarin.CommunityToolkit and Xamarin.CommunityToolkit.Markup.

Microsoft said that it will sunset the MauiCompat libraries alongside Xamarin.Forms in November 2022