You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/fundamentals/shell/navigation.md
+40-2
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: ".NET MAUI Shell navigation"
3
3
description: "Learn how .NET MAUI Shell apps can utilize a URI-based navigation experience that permits navigation to any page in the app, without having to follow a set navigation hierarchy."
Thisexampleretrievesthecurrentlyselectedbearinthe<xref:Microsoft.Maui.Controls.CollectionView>, asan `Animal`. The `Animal` objectisaddedtoa `Dictionary` withthekey `Bear`. Then, navigationtothe `beardetails` routeisperformed, withthe `Dictionary` beingpassedasanavigationparameter.
370
370
371
+
Anydatathat's passed as an `IDictionary<string, object>` argument is retained in memory for the lifetime of the page, and isn'treleaseduntilthepageisremovedfromthenavigationstack. Thiscanbeproblematic, asshowninthefollowingscenario:
Whilethisisdesirableinmanyscenarios, ifitisn't desired you should clear the `IDictionary<string, object>` argument with the `Clear` method after it'sfirstbeenreceivedbyapage.
Thisexampleretrievesthecurrentlyselectedbearinthe<xref:Microsoft.Maui.Controls.CollectionView>, asan `Animal` that's added to the `ShellNavigationQueryParameters` object. Then, navigation to the `beardetails` route is performed, with the `ShellNavigationQueryParameters` object being passed as a navigation parameter. After navigation has occurred the data in the `ShellNavigationQueryParameters` object is cleared.
396
+
397
+
:::moniker-end
398
+
371
399
Therearetwoapproachestoreceivingnavigationdata:
372
400
373
401
1. Theclassthatrepresentsthepagebeingnavigatedto, ortheclassforthepage's `BindingContext`, can be decorated with a `QueryPropertyAttribute` for each query parameter. For more information, see [Process navigation data using query property attributes](#process-navigation-data-using-query-property-attributes).
374
402
1. Theclassthatrepresentsthepagebeingnavigatedto, ortheclassforthepage's `BindingContext`, can implement the `IQueryAttributable` interface. For more information, see [Process navigation data using a single method](#process-navigation-data-using-a-single-method).
375
403
376
404
### Process navigation data using query property attributes
Copy file name to clipboardexpand all lines: docs/whats-new/dotnet-8.md
+1
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,7 @@ For information about what's new in .NET 8, see [What's new in .NET 8](/dotnet/c
39
39
- 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).
40
40
- 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).
41
41
- Several system fonts can be easily consumed in Android apps. For more information, see [Consume fonts](~/user-interface/fonts.md#consume-fonts).
42
+
- 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 data](~/fundamentals/shell/navigation.md#pass-data).
42
43
43
44
The following types or members have been deprecated:
0 commit comments