.NET MAUI in .NET 10 Preview 2 - Release Notes
March 18, 2025 ยท View on GitHub
Here's a summary of what's new in .NET MAUI, .NET for Android, and .NET for iOS, Mac Catalyst, macOS, and tvOS in this preview release:
.NET MAUI updates in .NET 10:
- What's new in .NET MAUI in .NET 10 documentation.
ShadowTypeConverter
.NET 10 includes a ShadowTypeConverter type for converting a formatted string to a Shadow on a VisualElement.
-
color, offset X, offset Y
<VerticalStackLayout BackgroundColor="#fff" Shadow="#000000 4 4" /> -
offset X, offset Y, radius, color
<VerticalStackLayout BackgroundColor="#fff" Shadow="4 4 16 #000000" /> -
offset X, offset Y, radius, color, opacity
<VerticalStackLayout BackgroundColor="#fff" Shadow="4 4 16 #000000 0.5" />
SpeechOptions Rate
When using Text-to-Speech in .NET 10 you now have the option to control the rate at which the audio plays by setting Rate on the SpeechOptions.
public async void SpeakSettings()
{
IEnumerable<Locale> locales = await TextToSpeech.Default.GetLocalesAsync();
SpeechOptions options = new SpeechOptions()
{
Rate = 2.0f, // 0.1 - 2.0
Pitch = 1.5f, // 0.0 - 2.0
Volume = 0.75f, // 0.0 - 1.0
Locale = locales.FirstOrDefault()
};
await TextToSpeech.Default.SpeakAsync("How nice to meet you!", options);
}
Styling Modal as Popover
With this new platform-specific you can display a modal page as a popover on iOS and Mac Catalyst. It's consumed by setting the Page.ModalPopoverSourceView bindable property to a View that defines the source of the modal, the Page.ModalPopoverRect bindable property to a Rectangle that defines the rectangle within the source of the modal, and the Page.ModalPresentationStyle bindable property to Popover:
public partial class PopoverPage : ContentPage
{
public PopoverPage(View modal, Rectangle rectangle)
{
InitializeComponent();
On<iOS>().SetModalPopoverView(modal);
On<iOS>().SetModalPopoverRect(rectangle);
On<iOS>().SetModalPresentationStyle(UIModalPresentationStyle.Popover);
}
}
Then, navigate to the modal page with the Navigation.PushModalAsync method:
Page modalPage = new PopoverPage(originButton, Rectangle.Empty);
await Navigation.PushModalAsync(modalPage);
More info see the GitHub pull request.
Switch.OffColor
You can now set the OffColor in addition to OnColor for a Switch control.
<Switch OffColor="Red"
OnColor="Blue" />
SearchBar.SearchIconColor
You can now set the color of the search icon that appears with a SearchBar by setting SearchIconColor.
<SearchBar Placeholder="Search items..." SearchIconColor="Red" />
HybridWebView new InvokeJavascriptAsync Method
A method for InvokeJavascriptAsync has been made public for when you don't want a generic argument or return type argument to be required as was the case previously.
More info see the GitHub pull request.
Deprecations
- The
FontImageExtensionXAML markup extension is deprecated. UseFontImageSourceinstead. - MessagingCenter is now internal. It can be replaced with WeakReferenceMessenger in the CommunityToolkit.Mvvm NuGet package. For more information, see Messenger.
.NET for Android
This release was focused on quality improvements. A detailed list can be found on dotnet/android GitHub releases.
.NET for iOS, Mac Catalyst, macOS, tvOS
This release was focused on quality improvements. A detailed list can be found on dotnet/macios GitHub releases including a list of Known issues.
Community Contributors
Thank you to community contributors @MartyIX, @StephaneDelcroix, @Zerod159, @jonathanpeppers, @jfversluis, @rmarinho, @albyrock87, @symbiogenesis, @pjcollins, @sthewissen, @spadapet, @PureWeen, @jsuarezruiz, @dotnet-bot, @rabuckley, @csigs, @pictos, @APoukar, @kubaflo, @piersdeseilligny, @tj-devel709, @jkurdek, @mohsenbgi, @SuthiYuvaraj, @KarthikRajaKalaimani, @BagavathiPerumal, @Tamilarasan-Paranthaman, @dotnet-maestro, @anandhan-rajagopal, @NirmalKumarYuvaraj, @Shalini-Ashokan, @Vignesh-SF3580, @Ahamed-Ali, @NanthiniMahalingam, @devanathan-vaithiyanathan, @prakashKannanSf3972, @Dhivya-SF4094, @nivetha-nagalingam, @NafeelaNazhir, @LogishaSelvarajSF4525, @HarishKumarSF4517, @bhavanesh2001, and @SubhikshaSf4851.