【发布时间】:2019-04-26 15:58:44
【问题描述】:
我正在构建一个包含这些页面的应用程序,按顺序:
(P): ContentPage(V): ContentView 托管在 ContentPage 上。->: 调用或正在执行的代码。
(P) Main
-> If login not detected, automatically goes to:
(P) Startup
(P) Sign up, has these ContentViews as registration steps:
(V) Email and password
(V) Name
(V) Profile photo
-> Call to CrossMedia.Current.TakePhotoAsync
(V) Other details
-> Returns to Main, if has successful profile creation.
(P) Sign in
-> Returns to Main, if has successful login.
-> If login detected:
-> Load the content of the Main page.
所以,每当我锁定我的应用程序的屏幕或切换应用程序(例如打开相机,通过调用 CrossMedia 插件)时,应用程序会再次直接进入主页面,这会将用户引导回启动页面,如果没有检测到登录。
有什么办法可以解决这个问题吗?如何? 我应该将导航堆栈保存在 OnSleep 方法的某处吗? 每个页面的DataContext呢?我怎样才能保存它们?
有没有办法阻止这种情况发生?
【问题讨论】:
标签: xamarin xamarin.forms navigation state-management