MVVM Conditional return navigation in Prism

2019-08-28 22:47发布

Here's the business problem I'm trying to solve:

Start with pages: Menu -> Activity -> Connect.

When the user navigates from Menu -> Activity, if there is a specific piece of hardware not connected, I want to immediately Navigate to the Connect page.

When back button is pressed on Connect page and there is still no device connected, we navigate back to Acitivyt. But now I do not want Activity to navigate again to Connect (trapping them in a loop). Rather I want to navigate all the way back to Menu. Prism does not (that I can find) provide a way for me to know if I'm arriving at the Activity page from the Connect page or from some other location.

In reality, Activity may be navigated to from a number of different places in the program, when they hit back on Connect, I want them to return to whatever page they came from before Activity (not necessarily Menu). What I'd like to know is how can I solve this conditional navigation problem in Prism?

0条回答
登录 后发表回答