By saying Shell.Current.GoToAsync("layout", true);
what you mean is go to a XAML Page by the name "layout" such as layout.xaml
, and therefore unsure what you try to do here. "layout" in your code is a content that is contained in a StackLayout
but shown as a XAML Page name with Shell.Current.GoToAsync()
. Are you using the same name for these two different things, content and Page?
You may also need to register the Routing of that Page in AppShell.xaml.cs, for instance as Routing.RegisterRoute(nameof(YourXamlPage), typeof(YourXamlPage));
where YourXamlPage
is where you want to navigate to (as explained above lacks clarity in your code as to whether "layout" is content to assign to current page, or a XAML Page to navigate to).