locked
Universal Hub App Template - Back button disappeared

    Question

  • Hi :)

    I've been playing around with the universal hub app template in VS2013 and I've ran into a problem where the back navigation button in the app header disappears when the app is debugged or deployed and run.

    This happens in all applications built from a template of this type not just the one it first happened in. The back button is also not visible in apps built from the targeted templates.

    I don't know the exact change that brought this about but I was adding content to the Hero section. I do know what I did so can reproduce the steps to try to reproduce the problem - but before I can do that I need to correct it.

    I've restarted, rebooted, deleted the original offending app, created new apps from the same/different templates. All have failed to reverse the problem.

    I'm missing something obviously, any pointers appreciated. Is it possible I've corrupted a vs resource file while experimenting?

    Thanks

    Steve




    Sunday, May 25, 2014 5:34 AM

Answers

  • I can't reproduce this with the default hub template in Visual Studio 2013 Update 2.

    Unless you've changed the code the back button is data bound to the back stack via the GoBackCommand: it will show if it's possible to go back (Frame.CanGoBack is true)  and not show if it's not possible (Frame.CanGoBack is false)

    Depending on your navigation pattern this could leave the back button visible on the landing page; however, I can't reproduce this with the default Hub App template. Going to the item detail page does a Frame.Navigate so there is a backstack and the button shows on the detail page. Returning by hitting the back button triggers the NavigationHelper.GoBackCommand which calls Frame.GoBack to return and unwind the back stack one. Barring other changes or navigations, this leaves the backstack empty, Frame.CanGoBack will be false, and the back button won't show.

    --Rob

    Tuesday, May 27, 2014 5:43 PM
    Owner

All replies

  • Where and when do you not see it? The back Button's visibility is data bound to the navigation backtrack so it shouldn't show up on the front page if no navigation has occurred.
    Sunday, May 25, 2014 4:03 PM
    Owner
  • thanks for responding Rob. The back button is visible after navigating to items but not at the top level which suggests your answer is correct but I thought it was there when I first ran the project.

    May be overkill but I'm going to setup another environment and check against a new install. I want to make sure.

    thanks

    Steve



    Sunday, May 25, 2014 4:53 PM
  • After further investigation it appears that the back nav button can be visible even if you have reached the top level in the page hierarchy.

    This happens in both dev and existing store apps whereby after navigating into say, item detail, then back up a hierarchy, the back button is visible on the landing page - clicking it does nothing except hide the button.

    So although Rob's answer is correct, the back button is sometimes visible when it shouldn't be.

    I can reproduce this behaviour.

    (please excuse me if my store app terminolgy is incorrect, just getting up to speed)


    Tuesday, May 27, 2014 3:50 PM
  • I can't reproduce this with the default hub template in Visual Studio 2013 Update 2.

    Unless you've changed the code the back button is data bound to the back stack via the GoBackCommand: it will show if it's possible to go back (Frame.CanGoBack is true)  and not show if it's not possible (Frame.CanGoBack is false)

    Depending on your navigation pattern this could leave the back button visible on the landing page; however, I can't reproduce this with the default Hub App template. Going to the item detail page does a Frame.Navigate so there is a backstack and the button shows on the detail page. Returning by hitting the back button triggers the NavigationHelper.GoBackCommand which calls Frame.GoBack to return and unwind the back stack one. Barring other changes or navigations, this leaves the backstack empty, Frame.CanGoBack will be false, and the back button won't show.

    --Rob

    Tuesday, May 27, 2014 5:43 PM
    Owner