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
In a Uno 5.5 app in the WASM target, when specifying the DataViewMapToQuery and FromQuery parameters as per this Uno documentation, and then navigating with NavigateDataAsync with the data parameter specified from a viewmodel to another viewmodel, the ToQuery is invoked, the navigation succeeds and the data parameter is injected in the destination viewmodel ctor.
However, the browser URL only contains the destination view route e.g. /EnergyNetwork, not the query URL parameters returned from ToQuery. Apparently the navigation parameter is passed in-memory, and not via (or reflected in) the browser url.
This prevents users from Uno WASM apps that support deep-linking to bookmark app pages as deep links, making the app browser unfriendly.
Expected behavior
As the above linked Uno documentation implies (but not states or illustrates) and as indicated by @kazo0here, the expected behavior is that the browser URL contains the query parameters after navigating.
I also expect the documentation to clearly state or illustrate the expected behavior, and it would be helpful if there was an example added in the Uno.Samples repo under Navigation, that uses query and/or path parameters used from viewmodel navigation. The only example I found in that repo is using a property of NavigationViewItem in XAML for query parameters (not sure if it works btw):
Based on initial investigation, the BrowserAddressBarService is properly subscribing to Route changes but the Route that is part of the event args does not have its Data property properly set with the original query parameters from the navigation's ToQuery result. This results in the route.Query() returning null
Changing this line to be: var responseRequest = navSegment with { Qualifier = route.Qualifier, Data = route.Data }; properly includes the data parameters to the BrowserAddressBarService and the url is properly displayed with the query parameters in the browser
Current behavior
In a Uno 5.5 app in the WASM target, when specifying the
DataViewMap
ToQuery
andFromQuery
parameters as per this Uno documentation, and then navigating withNavigateDataAsync
with thedata
parameter specified from a viewmodel to another viewmodel, theToQuery
is invoked, the navigation succeeds and thedata
parameter is injected in the destination viewmodel ctor.However, the browser URL only contains the destination view route e.g.
/EnergyNetwork
, not the query URL parameters returned fromToQuery
. Apparently the navigation parameter is passed in-memory, and not via (or reflected in) the browser url.This prevents users from Uno WASM apps that support deep-linking to bookmark app pages as deep links, making the app browser unfriendly.
Expected behavior
As the above linked Uno documentation implies (but not states or illustrates) and as indicated by @kazo0 here, the expected behavior is that the browser URL contains the query parameters after navigating.
I also expect the documentation to clearly state or illustrate the expected behavior, and it would be helpful if there was an example added in the Uno.Samples repo under Navigation, that uses query and/or path parameters used from viewmodel navigation. The only example I found in that repo is using a property of
NavigationViewItem
in XAML for query parameters (not sure if it works btw):From Uno.Samples Navigation:
App.xaml.cs
MainPage.xaml
How to reproduce it (as minimally and precisely as possible)
@kazo0 already created a minimal repro and kindly offered to attach it here
Relevant code snippets from my app:
Environment
Nuget Package (s), Package Version(s):
Affected platform(s):
Visual Studio:
Relevant plugins:
Anything else we need to know?
The text was updated successfully, but these errors were encountered: