Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 45 additions & 18 deletions docs/whats-new/dotnet-8.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,61 @@ For information about what's new in .NET 8, see [What's new in .NET 8](/dotnet/c

## New functionality

.NET MAUI for .NET 8 addresses top feedback issues and introduces the following new functionality:
While the focus of this release of .NET MAUI is quality, there's also some new functionality that enables new scenarios in your apps.

### Controls

- Controls that support text input gain extension methods that support hiding and showing the soft input keyboard. For more information, see [Hide and show the soft input keyboard](~/user-interface/controls/entry.md#hide-and-show-the-soft-input-keyboard).
- The <xref:Microsoft.Maui.Controls.ContentPage> class gains a `HideSoftInputOnTapped` property, which indicates whether tapping anywhere on the page will cause the soft input keyboard to hide if it's visible. For more information, see [ContentPage](~/user-interface/pages/contentpage.md).
- <xref:Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView> gains a `StartPath` property, a `TryDispatchAsync` method, and enhanced logging capabilities. For more information, see [Host a Blazor web app in a .NET MAUI app using BlazorWebView](~/user-interface/controls/blazorwebview.md).
- <xref:Microsoft.Maui.Controls.PointerGestureRecognizer> gains `PointerPressedCommand`, `PointerPressedCommandParameter`, `PointerReleasedCommand`, `PointerReleasedCommandParameter` properties, and `PointerPressed` and `PointerReleased` events. For more information, see [Recognize a pointer gesture](~/fundamentals/gestures/pointer.md).
- <xref:Microsoft.Maui.Devices.Flashlight> gains a `IsSupportedAsync` method that determines whether a flashlight is available on the device. For more information, see [Flashlight](~/platform-integration/device/flashlight.md).
- <xref:Microsoft.Maui.Devices.Sensors.SensorSpeed> intervals have been unified across all platforms. For more information, see [Accessing device sensors](~/platform-integration/device/sensors.md).
- <xref:Microsoft.Maui.Controls.SolidColorBrush.Color> is the [`ContentProperty`](xref:Microsoft.Maui.Controls.ContentPropertyAttribute) of the <xref:Microsoft.Maui.Controls.SolidColorBrush> class, and therefore does not need to be explicitly set from XAML.
- The position at which a drag or drop gesture occurred can be obtained by calling the `GetPosition` method on a <xref:Microsoft.Maui.Controls.DragEventArgs>, <xref:Microsoft.Maui.Controls.DragStartingEventArgs>, or <xref:Microsoft.Maui.Controls.DropEventArgs> object. For more information, see [Recognize a drag and drop gesture](~/fundamentals/gestures/drag-and-drop.md).
- <xref:Microsoft.Maui.Controls.WebView> gains a `UserAgent` property. For more information, see [WebView](~/user-interface/controls/webview.md).
- Inline media playback of HTML5 video, including autoplay and picture in picture, has been enabled by default for the <xref:Microsoft.Maui.Controls.WebView> on iOS. For more information, see [Set media playback preferences on iOS and Mac Catalyst](~/user-interface/controls/webview.md#set-media-playback-preferences-on-ios-and-mac-catalyst).
- Resources defined in a <xref:Microsoft.Maui.Controls.ResourceDictionary> can also be consumed in an [`AppThemeBinding`](xref:Microsoft.Maui.Controls.Xaml.AppThemeBindingExtension) with the [`DynamicResource`](xref:Microsoft.Maui.Controls.Xaml.DynamicResourceExtension) markup extension. For more information, see [Define and consume theme resources](~/user-interface/system-theme-changes.md#define-and-consume-theme-resources).
- The `Grid.Add` overload that accepts 5 arguments has been added back to .NET MAUI. However, this method is deprecated and is only present to aid migrations from Xamarin.Forms.
- <xref:Microsoft.Maui.Controls.Grid> gains an `AddWithSpan` extension method that adds a view to the `Grid` at the specified row and column with the specified row and column spans.
- On iOS, `MauiUIApplicationDelegate` gains a `PerformFetch` method that can be overridden or consumed via the `iOSLifecycle.PerformFetch` delegate. For more information, see [iOS platform lifecycle events](~/fundamentals/app-lifecycle.md#ios).
- The <xref:Microsoft.Maui.Controls.TapGestureRecognizer> class gains the ability to handle secondary taps on Android. For more information, see [Recognize a tap gesture](~/fundamentals/gestures/tap.md).

### Desktop

- Menu bar items and context menu items can be invoked through keyboard shortcuts known as keyboard accelerators. For more information, see [Keyboard accelerators](~/user-interface/keyboard-accelerators.md).

### Gesture recognizers

- <xref:Microsoft.Maui.Controls.PointerGestureRecognizer> gains `PointerPressedCommand`, `PointerPressedCommandParameter`, `PointerReleasedCommand`, `PointerReleasedCommandParameter` properties, and `PointerPressed` and `PointerReleased` events. For more information, see [Recognize a pointer gesture](~/fundamentals/gestures/pointer.md).
- The <xref:Microsoft.Maui.Controls.PointerEventArgs> object that accompanies the pointer events raised by the <xref:Microsoft.Maui.Controls.PointerGestureRecognizer> class gains a `PlatformArgs` property of type `PlatformPointerEventArgs`. This property provides access to the platform-specific arguments for a pointer gesture event. For more information, see [Recognize a pointer gesture](~/fundamentals/gestures/pointer.md).
- The <xref:Microsoft.Maui.Controls.DragStartingEventArgs>, <xref:Microsoft.Maui.Controls.DragEventArgs>, <xref:Microsoft.Maui.Controls.DropEventArgs>, and <xref:Microsoft.Maui.Controls.DropCompletedEventArgs> objects that accompany drag and drop gesture events each gain a `PlatformArgs` property. This property provides access to the platform-specific arguments for a drag or drop event. For more information, see [Recognize a drag and drop gesture](~/fundamentals/gestures/drag-and-drop.md).
- The position at which a drag or drop gesture occurred can be obtained by calling the `GetPosition` method on a <xref:Microsoft.Maui.Controls.DragEventArgs>, <xref:Microsoft.Maui.Controls.DragStartingEventArgs>, or <xref:Microsoft.Maui.Controls.DropEventArgs> object. For more information, see [Recognize a drag and drop gesture](~/fundamentals/gestures/drag-and-drop.md).
- The <xref:Microsoft.Maui.Controls.TapGestureRecognizer> class gains the ability to handle secondary taps on Android. For more information, see [Recognize a tap gesture](~/fundamentals/gestures/tap.md).

### Navigation

- Shell navigation gains a `GoToAsync` overload that enables you to pass single use navigation data, that's cleared after navigation has occurred, as a `ShellNavigationQueryParameters` object. For more information, see [Pass single use object-based navigation data](~/fundamentals/shell/navigation.md#pass-single-use-object-based-navigation-data).

### Platform integration

- The <xref:Microsoft.Maui.Devices.Sensors.Geolocation> class can listen for location changes when app's are in the foreground. For more information, see [Listen for location changes](~/platform-integration/device/geolocation.md#listen-for-location-changes).
- <xref:Microsoft.Maui.Devices.Flashlight> gains a `IsSupportedAsync` method that determines whether a flashlight is available on the device. For more information, see [Flashlight](~/platform-integration/device/flashlight.md).
- <xref:Microsoft.Maui.Devices.Sensors.SensorSpeed> intervals have been unified across all platforms. For more information, see [Accessing device sensors](~/platform-integration/device/sensors.md).
- The <xref:Microsoft.Maui.ApplicationModel.Permissions> class gains the `Bluetooth` permission, which is an Android 12 permission for looking for Bluetooth devices, making the current device discoverable to other Bluetooth devices, and communicating with already-paired Bluetooth devices. For more information, see [Permissions](~/platform-integration/appmodel/permissions.md).
- The <xref:Microsoft.Maui.ApplicationModel.Permissions> class gains the `NearbyWifiDevices` permission, which is an Android 13 permission for accessing nearby WiFi devices. For more information, see [Permissions](~/platform-integration/appmodel/permissions.md).

### XAML

- The `x:ClassModifier` attribute can be specified on XAML classes, to control the access level for a generated class in an assembly. For more information, see [Class modifiers](~/xaml/class-modifiers.md).
- Resources defined in a <xref:Microsoft.Maui.Controls.ResourceDictionary> can also be consumed in an [`AppThemeBinding`](xref:Microsoft.Maui.Controls.Xaml.AppThemeBindingExtension) with the [`DynamicResource`](xref:Microsoft.Maui.Controls.Xaml.DynamicResourceExtension) markup extension. For more information, see [Define and consume theme resources](~/user-interface/system-theme-changes.md#define-and-consume-theme-resources).
- <xref:Microsoft.Maui.Controls.SolidColorBrush.Color> is the [`ContentProperty`](xref:Microsoft.Maui.Controls.ContentPropertyAttribute) of the <xref:Microsoft.Maui.Controls.SolidColorBrush> class, and therefore does not need to be explicitly set from XAML.

### Troubleshooting

- For troubleshooting purposes, resource generation can be disabled. For more information, see [Disable image packaging](~/troubleshooting.md#disable-image-packaging), [Disable splash screen packaging](~/troubleshooting.md#disable-splash-screen-packaging), [Disable font packaging](~/troubleshooting.md#disable-font-packaging), and [Disable asset file packaging](~/troubleshooting.md#disable-asset-file-packaging).
- For troubleshooting purposes, a blank splash screen can be generated. For more information, see [Generate a blank splash screen](~/troubleshooting.md#generate-a-blank-splash-screen).
- Resizeter checks for duplicate image filenames. For more information, see [Duplicate image filename errors](~/troubleshooting.md#duplicate-image-filename-errors).
- Controls that support text input gain extension methods that support hiding and showing the soft input keyboard. For more information, see [Hide and show the soft input keyboard](~/user-interface/controls/entry.md#hide-and-show-the-soft-input-keyboard).
- The `x:ClassModifier` attribute can be specified on XAML classes, to control the access level for a generated class in an assembly. For more information, see [Class modifiers](~/xaml/class-modifiers.md).
- The <xref:Microsoft.Maui.ApplicationModel.Permissions> class gains the `Bluetooth` permission, which is an Android 12 permission for looking for Bluetooth devices, making the current device discoverable to other Bluetooth devices, and communicating with already-paired Bluetooth devices. For more information, see [Permissions](~/platform-integration/appmodel/permissions.md).
- The <xref:Microsoft.Maui.ApplicationModel.Permissions> class gains the `NearbyWifiDevices` permission, which is an Android 13 permission for accessing nearby WiFi devices. For more information, see [Permissions](~/platform-integration/appmodel/permissions.md).
- Several system fonts can be easily consumed in Android apps. For more information, see [Consume fonts](~/user-interface/fonts.md#consume-fonts).
- Shell navigation gains a `GoToAsync` overload that enables you to pass single use navigation data, that's cleared after navigation has occurred, as a `ShellNavigationQueryParameters` object. For more information, see [Pass single use object-based navigation data](~/fundamentals/shell/navigation.md#pass-single-use-object-based-navigation-data).

### Miscellaneous

- Window management can be decoupled from the `App` class. For more information, see [Decouple window management from the App class](~/fundamentals/windows.md#decouple-window-management-from-the-app-class).
- Menu bar items and context menu items can be invoked through keyboard shortcuts known as keyboard accelerators. For more information, see [Keyboard accelerators](~/user-interface/keyboard-accelerators.md).
- The <xref:Microsoft.Maui.Devices.Sensors.Geolocation> class can listen for location changes when app's are in the foreground. For more information, see [Listen for location changes](~/platform-integration/device/geolocation.md#listen-for-location-changes).
- The <xref:Microsoft.Maui.Controls.ContentPage> class gains a `HideSoftInputOnTapped` property, which indicates whether tapping anywhere on the page will cause the soft input keyboard to hide if it's visible. For more information, see [ContentPage](~/user-interface/pages/contentpage.md).
- Several system fonts can be easily consumed in Android apps. For more information, see [Consume fonts](~/user-interface/fonts.md#consume-fonts).
- On iOS, `MauiUIApplicationDelegate` gains a `PerformFetch` method that can be overridden or consumed via the `iOSLifecycle.PerformFetch` delegate. For more information, see [iOS platform lifecycle events](~/fundamentals/app-lifecycle.md#ios).

## Type deprecation and removal

The following types or members have been deprecated:

Expand All @@ -62,6 +87,8 @@ The following types or members have been removed:
- The `PhoneDialer.Current` property has been removed. Use `PhoneDialer.Default` instead.
- `OpenGLView` has been removed.

## Behavior changes

The following behavior has changed from the previous release:

- Use of the <xref:Microsoft.Maui.Controls.Maps.Map> control from XAML now requires the following `xmlns` namespace declaration: `xmlns:maps="http://schemas.microsoft.com/dotnet/2021/maui/maps"`.
Expand Down