MVVM Conditional return navigation in Prism

筅森魡賤 提交于 2020-01-06 05:16:04

问题


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?

来源:https://stackoverflow.com/questions/52616823/mvvm-conditional-return-navigation-in-prism

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!