I have a really strange issue relating to how I handle navigation in an application, and that application now being rejected from AppHub (after being successfully approved a number of times on the same code base… grr)
- currently I am capturing the first navigation of the application and routing it an “add item” page in the App.cs using the example found here
- the user then adds an “item”
- the user is taken to the “main” page again, but stay there are there is now 1 “item” to show in a list
- the user then can view a “detail” page of this item where they can select to delete the current item. when they do that I redirect them to the “main” page again.
- this navigation then fires the same thing that happened in step 1
and they are routed to an “add” page
the problem with the above process, is that if the user hits “back” on the routed page in step 5 they don’t go anywhere as they are routed back to the current page (because there are no items on the page previous and this fires the app.cs routing event to take them to the add page). if I did allow for them to go back, the actual first page they would be able to go back to is 3 nav steps back, when they first added the item – as they are on the “add item” page already, this would be pointless.
The apphub store testers say that in this instance, the application should close. I really don’t know how the f&*k I am meant to make this happen, as there is no “go back until close” action I can call…
thoughts?
When the user decides to “delete” the current item, you shouldn’t navigate forward to the main page, leaving the deleted item in the navigation stack. You should navigate back to the main page. That way the navigation stack will be empty, and if they navigate back again, the app will close.
(The same is true at step 3, of course – when the item is added, navigate back to the main page. You don’t want the “add” page as part of the navigation stack; that action has been completed.)