Search code examples
windows-phone-7navigationapp-hub

Non Linear Navigation Service


I'm creating an app that has start button which brings you to start page from anywhere in app.

However back navigation stack hurts when I just navigate to start page.

Looking for solution I found NonLinearNavigationService. The trouble is that download links are target to app hub, which (now, as we have new better app hub) redirects me to main page and nowhere further. Also I failed to find it on app hub using build in search engine.

Anyone knows where from can I get it?

Or maybe another solution for navigation loops?


Solution

  • If you use RemoveBackEntry(), the entries are programmatically cleared from the backstack so you don't have to deal with the side effects of actually navigating back through the pages to pop them off the stack.

    The NonLinear Navigation Service effectively does what you have tried. It calls GoBack() to traverse back up the stack. What it additionally does to prevent the flicker is to make the root frame transparent. See this question:

    Skip a page when the back button is pressed, WP7

    I don't want to call your question a duplicate because I think before Mango came out, that was probably the solution that needed to be used. Now that RemoveBackEntry() has been added to NavigationService, I think using that would probably be the better approach.