简体   繁体   中英

Reactivating to new page - Windows 8 app

Here's the basic structure of my app: I have a splash screen --> extended splash screen --> goes to a login.html page (not default.html which it normally would) --> home.html.

Essentially, after the extended splash screen, the user is redirected to a login page. Once they login successfully, it opens the home page. I had to alter some of the default behavior as described here because I wanted to go to the login.html, not remain using default.html -- if that makes any sense.

Now what I want is to handle the lifecycle of the app. Whenever the user alt-tabs, presses the windows key, or leaves the app in anyway, I need to save the session (which is easiest enough since Windows 8 does it automatically and provides some method stubs for this), but then redirect them to the login screen. Once they login successfully again I want to display the previous session state. Any idea on how best to do this? It's throwing that login screen back in there that is throwing me off.

Any input would be great.

You can redirect the user on the resume event handler:

Windows.UI.WebUI.WebUIApplication.addEventListener("resuming", function () {
  window.location.href= "login.html";
}, false);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM