[英]Login Screen for Windows Store App - What would be the best approach?
I've just started developing for Windows Store App and I have an app which requires a login screen. 我刚刚开始为Windows Store App开发,并且我有一个需要登录屏幕的应用。 This login is just to select user records and should not be related to any social network.
该登录名仅用于选择用户记录,不应与任何社交网络相关。 My first approach was create a XAML page and load that page when the app starts, in the App.xaml.cs Then I saw some people using Popups to ask for login, handling the code in the Main.xaml code behind.
我的第一种方法是创建一个XAML页面,并在应用程序启动时在App.xaml.cs中加载该页面。然后我看到一些人使用弹出窗口进行登录,并处理后面的Main.xaml代码中的代码。 What would be the best approach?
最好的方法是什么?
Thanks. 谢谢。
Microsoft give some Guidelines for login. Microsoft提供了一些登录准则。 You can get it here .
你可以在这里得到 。
Guidelines are not an obligation. 准则不是义务。 It is just classic and valid way to do something.
这只是做某事的经典且有效的方法。 Maybe a pop up is an accepted idea, for now maybe you should follow the "basic" way.
也许弹出窗口是一个可以接受的想法,现在也许您应该遵循“基本”方式。
I think both options are possible. 我认为两种选择都是可能的。 Based on your comments I would suggest build a Login usercontrol that you can use at multiple places.
根据您的评论,我建议您构建一个可在多个地方使用的Login用户控件。 Because you have to login everytime the user starts the app, I would build a loginpage where the app default navigates to from the app.xaml.cs
因为您每次用户启动应用程序时都必须登录,所以我将构建一个登录页面,在该页面中,应用程序默认从app.xaml.cs导航至
In case where the app is resumed and you determine that the user has to login again to continue using the app, I would use an overlay over the page where the user already was and load the usercontrol. 如果恢复了应用程序,并且您确定用户必须再次登录才能继续使用该应用程序,则可以在该用户已经存在的页面上使用一个覆盖图并加载usercontrol。 When the user is logged in again, you can just hide the overlay and the user can continue where he left.
当用户再次登录时,您可以隐藏该叠加层,然后该用户可以继续其离开的位置。
Pro: No logic for remembering where the user came from. 优点:没有记住用户来源的逻辑。
Con: Overlay should be added on every page. 缺点:应该在每个页面上添加覆盖。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.