Xamarin.Forms
Xamarin.Forms copied to clipboard
[Bug] Shell.Current.CurrentState.Location doesn't contain query parameters
Description
When using await Shell.Current.GotoAsync( "page?id=blah" ), query parameters don't seem to be preserved as part of Shell.Current.CurrentState.Location. It makes it difficult to have code like the following work since state can't be properly restored.
public partial class App
{
protected override void OnStart()
{
var myRoute = Preferences.Get("my_route", "");
if (myRoute != "")
{
Shell.Current.GoToAsync(myRoute);
}
}
protected override void OnSleep()
{
var myRoute = Shell.Current.CurrentState.Location.ToString();
Preferences.Set("my_route", myRoute);
}
}
Steps to Reproduce
- Create a shell app
- Navigate to a page with a query parameter
- check value of
Shell.Current.CurrentState.Location
Expected Behavior
Should have the query parameter(s) used to navigate to the page
Actual Behavior
Doesn't have the query parameters
Basic Information
- Version with issue:
- Last known good version:
- Platform Target Frameworks:
- iOS:
- Android:
- UWP:
- Android Support Library / AndroidX Version:
- NuGet Packages:
- Affected Devices:
Environment
Show/Hide Visual Studio info
Build Logs
Screenshots
Reproduction Link
Workaround
Hello! Did you find any workaround to get parameters?