Windows Phone 7 Sign in screen redirect

后端 未结 4 1865
时光说笑
时光说笑 2020-12-19 03:07

Apologise if there is answer for this somewhere else, I can\'t find any.

I imagine this is a common situation. The first time the user runs the application I want th

相关标签:
4条回答
  • 2020-12-19 03:18

    Unfortunately the WP7 navigation framework doesn't handle the "do something on first run" situation very nicely at all.

    I suspect the problem you're seeing is that you don't have a NavigationService yet... but even if you did, you'd have a problem: the user could still hit the "back" button. You can't even work around that, because the user pressing back should exit the app... but there's no way I'm aware of for doing that without already being at the first page naturally when the user hits the back button.

    The only workaround I've found for this is to have the "sign-in" view in the same page as the normal first page, and display one or the other conditionally. Yes, it sucks... but it's the only approach I've found which works. If you find another, I'll be happy to hear about it :)

    0 讨论(0)
  • 2020-12-19 03:18

    Peter Torr covers page redirections quite well here. Two methods are offered with relative merits covered. Edit: Note you can redirect to a login page, rather then employing the popup suggestion for login handling.

    Redirecting an initial navigation - Peter Torr's Blog

    I'd also recommend familiarising with his accompanying post on places here.

    Introducing the concept of “Places” - Peter Torr's Blog

    This address back stack handling (certification consideration) and addresses scenarios such as login pages.

    0 讨论(0)
  • 2020-12-19 03:22

    I was able to get Peter Torr's UriMapper approach to work with the separate login / welcome page. The main thing was changing the Uri of the UriMapper again after the login and then changing the query string when navigating back to MainPage.xaml after finishing with the login / welcome page. Otherwise when attempting to navigate to MainPage.xaml from the login page, nothing happened.

    For more info and a sample project see http://www.geoffhudik.com/tech/2012/2/19/windows-phone-login-navigation.html. I welcome any thoughts and better suggestions.

    0 讨论(0)
  • 2020-12-19 03:23

    Rather than have your main page navigate to a sign in page (which will upset you back stack). Either conditionally set the first page or have the login appear as a popup.

    Have a look at this question for more on the subject.

    0 讨论(0)
提交回复
热议问题