How to get a Back button on Windows Phone 8.1 ?

JohnHardmanJohnHardman GBUniversity mod
edited July 2015 in Xamarin.Forms

The code that I am using to display a back button works on all platforms other than Windows Phone 8.1. It is fine on Android, iOS, Windows Phone 8.0 and WinRT / Windows. Does anybody know what I need to do to get the back button working on Windows Phone 8.1 ?

    public static void SetNavigationBarAndBackButton(
        ContentPage contentPage, 
        bool showBackButton,
        String backButtonText)
    {
        NavigationPage.SetHasBackButton(
            contentPage, 
            showBackButton);

        if (showBackButton)
        {
            NavigationPage.SetBackButtonTitle(
                contentPage, 
                backButtonText != null ? backButtonText : "Back"); // TODO - get from resources
        }

        NavigationPage.SetHasNavigationBar(contentPage, true);
    }
Sign In or Register to comment.