On July 15th, Microsoft rolled out the sixth preview of .NET MAUI in .NET 10, introducing a couple of new features and improvements aimed at enhancing developer productivity and framework performance. This preview focuses on refining three existing controls (MediaPicker, WebView, and HybridWebView), along with updates and stability fixes for platform-specific code.
MAUI is an acronym that stands for Multiplatform Application UI. According to Microsoft, it’s an evolution of Xamarin and Xamarin Forms frameworks, unifying separate target libraries and projects into a single project for multiple devices. Currently, MAUI supports writing applications that run on Android 5+, iOS 12.2+, macOS 12+ (as Mac Catalyst), Samsung Tizen (although there are changes to remove Tizen templates in this release), Windows 10 version 1809+, or Windows 11. There are no changes in the supported minimum platforms from the version 9, released last year, although the preview 6 adds support for Android API levels 35 and 36.
One of the standout features in this release is the enhancement of the MediaPicker control. Developers can now select multiple files and compress images directly through the API using MaximumWidth
and MaximumHeight
parameters. This functionality simplifies handling media files within applications, making it easier to manage and process user-generated content without additional processing.
var result = await MediaPicker.PickMultipleAsync(new MediaPickerOptions
{
MaximumWidth = 1024,
MaximumHeight = 768
});
Another significant addition is the ability to intercept and respond to web requests made from BlazorWebView and HybridWebView controls. This feature allows developers to modify headers, redirect requests, or supply local responses, providing greater control over web content and interactions within their applications.
webView.WebResourceRequested += (s, e) =>
{
if (e.Uri.ToString().Contains("api/secure"))
{
e.Handled = true;
e.SetResponse(200, "OK", "application/json", GetCustomStream());
}
};
As for performance and stability improvements, this preview also includes numerous fixes and improvements to controls and layout behavior. CollectionView
, CarouselView
, and SearchBar
now offer more reliable performance across platforms, with enhancements in selection updates, placeholder color updates, and memory management. A memory leak in CarouselViewHandler2
on iOS has been fixed, improving overall application stability. The Switch control now uses the native default “on” color when OnColor property is not set (this property sets the color of the switch when toggled on), ensuring a more consistent user interface.
This preview is one of the milestones for the final release of .NET MAUI in .NET 10. The next preview, .NET MAUI 10 Preview 7 is scheduled for August 1st. Developers are encouraged to explore these new features and provide feedback to help shape the future of .NET MAUI. Readers can refer to GitHub official MAUI repository for complete release notes.