Search code examples
c#.netwindows-phone-8

windows phone skipping frames in navigation


I have an app where you could go through in views like;

play -> normal or custom -> select map -> summary -> start

I would like to make a shortcut option from play to summary, but I also want navigation back to select map page with the back button functionality.

So the normal workflow p->noc->sm->summary but I want to implement p->sm with the noc<-sm<-summary back functionality too (with the windows phone back button).

I saw how can I delete items from the backstack, but google not helped me how can I navigate through a couple of windows without showing that to the user.

Am I need to override the back button or there is a "better" way to do that?

It's a WP8 project.

Edit:

I didnt need the exact codesnippet for this just a design concept in this patform. (just for the is it duplicated guy)

My normal or custom and select map page should be randomized when I do the shortcut, both of these pages has a "button" which can randomize those settings, I just want a swipe->press->swipe->press->swipe actions shortened to a button press without loosing the 'post modification after randomized' feature.

After I read your comments I think I will handle the back button all of the mentioned views so the backstack will not be getting inconsistent at any state. If I understand well I can tell it in every page what is the "backed" page.


Solution

  • You can't inject pages into the backstack. You can override the back button and do a forward navigation with the animations you would normally do when going backward (and then remove the page you just came from off the stack), but honestly, this all gets complicated and for good reason. One of the few hard truths of Windows Phone design is that you shouldn't mess with the backstack.

    Instead, I would rethink your flow. It seems like your second page is a setting of some sort (Normal or Custom). If that is changeable, maybe make a button that can float a modal popup on top of the page and move things around according to the new decision.

    Looking again at your flow, it seems like several of the pages may be settings. Can you combine those into one page, maybe on a pivot or panorama? That way making changes is just a swipe away.

    Regardless, while it is possible to do what you are looking to achieve, I would look long and hard at whether it is actually the best experience for your users.