Saturday, December 26, 2015

How to Enable Back Button In Windows 10 UWP

Enable back button in the app title bar Windows 10 UWP

In Windows 10 UWP the back button is disabled by default. If you need back button in the application title bar you need to enable it. I will show how to enable this button.

 Write the following code to enable the back button.

 protected override void OnNavigatedTo(NavigationEventArgs e)

            Frame rootFrame = Window.Current.Content as Frame;

            if (rootFrame.CanGoBack)
                // If we have pages in our in-app backstack and have opted in to showing back, do so
                SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
                // Remove the UI from the title bar if there are no pages in our in-app back stack
                SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;

No comments:

Post a Comment

Your project is not referencing the "MonoAndroid,Version=v8.1" framework. Add a reference to "MonoAndroid,Version=v8.1" in the "frameworks" section of your project.json, and then re-run NuGet restore.

I had  the same problem. Reason: file obj/project.assets.json target "MonoAndroid,Version=v7.1" when my project target androi...