ICYMI here is what’s in store for .NET MAUI in .NET 10.
✨ One of my most frequent recommendations when you study or work with any technology is to stay up to date with the latest updates. This helps you to keep your projects current and to take advantage of the newest features.
That’s why today I’m bringing you a summary of what’s new in .NET MAUI for .NET 10. So grab your cup of coffee and let’s get started! ☕ As you know, the Microsoft team always defines a clear goal for each release and works hard to achieve it. In this case, the main focus of .NET MAUI in .NET 10 has been improving product quality.
In .NET 10, .NET MAUI is distributed as a .NET workload along with several NuGet packages. But, what is the advantage of this approach? 🤔 It allows you to easily pin your projects to specific versions, while also giving you simple access to preview or experimental builds.
Some methods have been deprecated. Below is a table with their replacements:
As you can see, the syntax itself hasn’t changed drastically. In fact, the only difference is that all the existing methods now simply require adding the suffix “Async” at the end.
“This is now removed from templates and releases. Use .NET MAUI layouts.”
What is Compatibility.Layout?
It is part of the Microsoft.Maui.Controls.Compatibility namespace, which allowed many Xamarin.Forms components to be compatible with .NET MAUI. Therefore, if you had an older app, you could still work with the previous layouts without any issues.
What does it mean that it was removed?
In this case, for .NET 10, it is no longer included. However, this is not a problem since you can replace it with the currently available layouts such as Grid, VerticalStackLayout, HorizontalStackLayout and FlexLayout, which can replicate the same behavior but with better performance and more aligned with modern best practices.
In .NET MAUI, the Entry and Editor controls are rendered using native views on each platform. In the case of Android, up until .NET 9 both controls used the native AppCompatEditText.
With .NET 10, these controls now use MauiAppCompatEditText, a custom .NET MAUI class derived from AppCompatEditText.
The main improvement introduced by this change is support for the SelectionChanged event, which was previously not available on Android.
With .NET 10, you can now intercept web requests with the BlazorWebView and HybridWebView controls. This means that every time your app makes a request to a URL, you can intervene to modify it—for example, redirect it to another domain or add authentication headers.
Let’s look at an example of how to do this:
webView.WebResourceRequested += (s, e) =>
{
if (e.Uri.ToString().Contains("api/secure"))
{
e.Handled = true;
e.SetResponse(200, "OK", "application/json", GetCustomStream());
}
};
In the example, the following is happening:
e.Handled = true
indicates that your application takes care of the response.e.SetResponse
method, the parameters mean:
200
: The HTTP status code being returned."OK"
: The message associated with the status code."application/json"
: The content type of the response (in this case, a JSON).GetCustomStream()
: The data stream (Stream) that contains the actual response; here you can return a local JSON, a file or any content you want to send to the WebView.The ListView control has been deprecated, along with the cell types EntryCell, ImageCell, SwitchCell, TextCell and ViewCell. Instead, you should use CollectionView, which provides better performance and greater flexibility (as it allows for more complex designs).
⚠️ The Cell class has not yet been officially deprecated, since it’s still used internally; however, Microsoft makes it clear that it should also be considered obsolete.
In Xamarin.Forms and inherited in the early versions of .NET MAUI, the TableView was a control designed to display data in a structured table format.
But now, this control has been deprecated, and you can replace it with the CollectionView.
“The IsBusy
property is marked obsolete.”
Although the IsBusy
property still works for compatibility, it’s best to avoid using it in future implementations. Since there’s still time, I recommend gradually replacing it in your projects if you already have it implemented.
The SearchBar now includes two properties:
SearchIconColor
: A bindable property that lets you set the color of the search iconReturnType
: A bindable property that specifies the appearance of the return button (the default value is Search)Example in XAML:
<SearchBar Placeholder="Search items..."
SearchIconColor="Red" />
The Switch now includes a new property:
OffColor
: A bindable property that sets the color of the switch when it’s in the off stateExample in XAML:
<Switch OffColor="Red"
OnColor="Green" />
Vibration and HapticFeedback now include the IsSupported
property, which allows you to check whether the feature is available on the platform where your app is running.
The MediaPicker has been improved with two important capabilities:
MaximumWidth
and MaximumHeight
parameters, which let you set the maximum size of the images when they are selected.For example:
var result = await MediaPicker.PickMultipleAsync(new MediaPickerOptions
{
MaximumWidth = 1024,
MaximumHeight = 768
});
The SpeechOptions
class now includes a Rate
property, which allows you to control the playback speed of the voice.
Some methods have been deprecated. Below is a table with their replacements:
As you can see, the syntax itself hasn’t changed drastically. In fact, the only difference is that all the existing methods now simply require adding the suffix “Async” at the end.
This release introduces important improvements to SafeArea management:
SafeAreaEdges
property has been enhanced, allowing for more precise behavior within safe areas.SafeAreaEdges
has been resolved, along with other issues that occurred on iOS.The SafeAreaEdges property
is available on the following controls:
This has been a brief summary of some of the key updates Microsoft announced for .NET MAUI in .NET 10. For more details, I recommend reading the full article “What’s New in .NET MAUI for .NET 10.”
Don’t forget to start applying these updates in your projects! And if you have any questions, feel free to drop them in the comments.
See you in the next one! 🙋♀️💚
Leomaris Reyes is a Software Engineer from the Dominican Republic, with more than 5 years of experience. A Xamarin Certified Mobile Developer, she is also the founder of Stemelle, an entity that works with software developers, training and mentoring with a main goal of including women in Tech. Leomaris really loves learning new things! 💚💕 You can follow her: Twitter, LinkedIn , AskXammy and Medium.