On Page#3, by pressing build in back button, its going back to page 2. so far so good
But, On Page#4, by pressing build in back button, it doesnt go back to Page#3. Why not?
here is log: according to logs, issue is in Page#3
[0:] Shell: Failed to Navigate Back:
System.ArgumentException:
Ambiguous routes matched for: //D_FAULT_FlyoutItem7/IMPL_MyWalletPage/MyWalletPage/Page3 matches found:
//D_FAULT_FlyoutItem7/IMPL_MyWalletPage/MyWalletPage/Page3,//D_FAULT_FlyoutItem7/IMPL_MyWalletPage/MyWalletPage/Page3
Parameter name: uri
at Xamarin.Forms.ShellUriHandler.GetNavigationRequest (Xamarin.Forms.Shell shell, System.Uri uri, System.Boolean enableRelativeShellRoutes, System.Boolean throwNavigationErrorAsException, Xamarin.Forms.ShellNavigationParameters shellNavigationParameters) [0x000aa] in D:\a\1\s\Xamarin.Forms.Core\Shell\ShellUriHandler.cs:207
at Xamarin.Forms.ShellNavigationManager.GoToAsync (Xamarin.Forms.ShellNavigationParameters shellNavigationParameters) [0x000b8] in D:\a\1\s\Xamarin.Forms.Core\Shell\ShellNavigationManager.cs:44
at Xamarin.Forms.ShellSection+NavigationImpl.OnPopAsync (System.Boolean animated) [0x000e9] in D:\a\1\s\Xamarin.Forms.Core\Shell\ShellSection.cs:1070
at Xamarin.Forms.Platform.Android.ShellToolbarTracker.OnNavigateBack () [0x0002a] in D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ShellToolbarTracker.cs:207
Page#1: I added //becuase i want ShellApp build-in menu in Page#2, and not a back button
async Task OnKeypadSubmitTapCommand()
{
var route = $"//{ nameof(Page2)}";
await Shell.Current.GoToAsync(route);
}
Page#2: Shell.Current.CurrentState.Location here is \\Page2
private async void Button_Clicked(object sender, EventArgs e)
{
var route = $"{ nameof(Page3)}";
await Shell.Current.GoToAsync(route);
}
Page#3: Shell.Current.CurrentState.Location here is \\Page2
private async void Button_Clicked(object sender, EventArgs e)
{
var route = $"{ nameof(Page4)}";
await Shell.Current.GoToAsync(route);
}
Page#4: Shell.Current.CurrentState.Location here is \\Page2\Page3
private async void Button_Clicked(object sender, EventArgs e)
{
...
}
register routes
Routing.RegisterRoute(nameof(Page0), typeof(Page0));
Routing.RegisterRoute(nameof(Page1), typeof(Page1));
Routing.RegisterRoute(nameof(Page2), typeof(Page2));
Routing.RegisterRoute(nameof(Page3), typeof(Page3));
Routing.RegisterRoute(nameof(Page4), typeof(Page4));
FlyoutItem
<FlyoutItem Title="Splash Screen" Icon="icon_about.png" FlyoutItemIsVisible="false">
<ShellContent Route="Page0" ContentTemplate="{DataTemplate local:Page0}" />
</FlyoutItem>
<FlyoutItem Title="HomePage" Icon="icon_about.png">
<ShellContent Route="Page2" ContentTemplate="{DataTemplate local:Page2}" />
</FlyoutItem>
Folders
>Folder1
>Page#1
>Folder2
>Page#3
>Page#4
>Page#2
I looked on google but no solution. I know GoToAsync works by stacking pages pushing on top and popping it. in my code above, from page#2, I am starting to stack up pages so going back should work