I have a simple Xamarin Forms app using UWP. I am pushing to a new view:
await Navigation.PushAsync(new NavigationPage(new MyDetailView()));
When that view loads, there is no back button to return up the stack. What is the recommended approach? Note in iOS the back button is present.
The back button on Desktop can be shown using the following code snippet:
SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility =
AppViewBackButtonVisibility.Visible;
This will display the back button in the app's title bar. You might want to update this status on each navigation, so that the button is not displayed when it is not needed (when the navigation stack is empty).
But I guess this should happen automatically, as this is the behavior that is already in the Xamarin.Forms - see the NavigationPageRenderer source line 463.
I think the problem might be the fact, that you are pusing a the new view wrapped inside a new NavigationPage
which steals the navigation stack and has it empty. I suppose this should work as you expect and solve your problem (pushing just the new view in the existing NavigationPage
):
Navigation.PushAsync( new MyDetailView() );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With