Xamarin Forms - UWP Back Button?

I have a simple Xamarin Forms application using UWP. I am approaching a new look:

await Navigation.PushAsync(new NavigationPage(new MyDetailView())); 

When this view loads, there is no going back to get the stack back. What is the recommended approach? Please note that iOS has a back button.

+6
source share
1 answer

The Back button on the desktop can be shown using the following code snippet:

 SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible; 

This will display the back button in the application title bar. You can update this status with each navigation so that the button does not appear when it is not needed (when the navigation pool is empty).

But I assume that this should happen automatically, as this is the behavior that Xamarin.Forms already has - see NavigationPageRenderer source line 463.

I think the problem may be that you are using a new view enclosed in a new NavigationPage that steals the navigation stack and is empty. I believe this should work as you expect and solve your problem (by clicking only the new view in the existing NavigationPage ):

 Navigation.PushAsync( new MyDetailView() ); 
+6
source

All Articles