返回特定的全景/透视项目?
我想知道当用户按“后退按钮”时是否可以进入 WP7 sdk 上的特定枢轴或全景项目。
I would like to know if is it possible when a user press "back button" to go in a specific pivot or panorama item on WP7 sdk.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以通过重写
OnNavieratedFrom
和OnNavieratedTo
事件并使用PhonePageApplication.State
属性,确保用户始终返回到他们离开的项目存储所选项目。即使应用程序在不同页面上被逻辑删除,这也将起作用。例如:
请注意上面的内容未经测试,需要额外的检查和错误处理等,但应该足以让您开始。
You can make sure that the user is always returned to the item they left by overriding the
OnNavigatedFrom
andOnNavigatedTo
events and using thePhonePageApplication.State
property to store the selected item. This will work even if the app is tombstoned while on a different page.Something like:
Please note the above is untested, requires additonal checks and error handling, etc. but should be enough to get you started.
通过在页面中实现
OnBackKeyPress
覆盖可能来实现此方法,但是,这与 Windows Phone 7 应用程序中的后退按钮行为不一致。后退按钮应该仅用于在应用程序的页面堆栈中向后导航,然后让应用程序在应用程序堆栈中向后导航。实施任何其他行为都是违反直觉的,并且也很可能无法通过认证。It would be possible to implement this approach by implementing the
OnBackKeyPress
override in your page, however, this would not be consistent with back button behavior in Windows Phone 7 applications. The back button is supposed to only be used for navigating backwards through the application's page stack, and then to leave the application to navigate backwards through the application stack. To implement any other behavior would be counter-intuitive and is also highly likely to fail certification.