.NET MAUI lets you write a single C# and XAML application for Android, iOS, macOS and Windows, using each platform's native controls. In .NET 10 the work focused on quality, performance and API clean-up.
XAML generated at compile time
The XAML source generator turns pages into C# code during compilation, instead of interpreting them at startup. Markup errors show up earlier and pages open faster.
<PropertyGroup>
<MauiXamlInflator>SourceGen</MauiXamlInflator>
</PropertyGroup>
Deprecated controls and APIs
- ListView and TableView are deprecated:
CollectionViewis the control to use for lists. - MessagingCenter is no longer public: use the CommunityToolkit's
WeakReferenceMessenger. - Application.MainPage gives way to overriding
CreateWindow.
public partial class App : Application
{
public App() => InitializeComponent();
protected override Window CreateWindow(IActivationState? activationState) =>
new(new AppShell());
}
Other improvements
- Finer control of safe areas (notches, system bars) for each edge of the screen.
- Multiple selection of photos and videos in the media picker.
- Improved interoperability between C# and JavaScript in
HybridWebView. - Support for the latest Android and iOS versions.
How to upgrade
Change the target frameworks to net10.0-android, net10.0-ios and so on, update the workloads with dotnet workload update and tackle the deprecation warnings first: they are the list of things to fix before they become errors.
Comments (0)
No comments yet.