Remove a page from Navigation Stack

前端 未结 6 1470
暖寄归人
暖寄归人 2021-01-11 11:05

I have this application schema :

[List Page] -> [Detail Page] -> [ShareOnFacebook Page]
                     ^__________________|
    <
6条回答
  •  情深已故
    2021-01-11 11:21

    I have a similar situation in my app, i solve it with a very simple solution.

    If you want to "skip" a page in your backstack, place some logic in the NavigatedTo() function of that page.

    For example: you can have a bool that you set to true when you post to facebook, and then place the following code in the NavigatedTo() function of the ShareOnFacebook page.

    Here is pseudo code:

    if (alreadyPosted) Navigation.GoBack();

    The GoBack() function will skip this page and return to the previous one, the user will never see the page.

提交回复
热议问题