已保存状态问题 [英] Saved State issue

查看:96
本文介绍了已保存状态问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个正在编写的应用程序"c#",我们遇到了问题.当应用启动时,它会加载一个图像,然后加载第二个图像,并开始中介和一对计时器.这些计时器触发淡入淡出事件,以便应用程序的标题,然后是 选项出现.但是,当按下手机上的开始"按钮,然后您尝试从后退按钮冻结的情况下重新启动该应用程序并且不会继续加载.我知道我应该在Application_Activated中写一些东西 正确重新启动应用程序,但我无法确定需要输入什么.是否有可能引发我们的公众空白"用来启动应用程序,以便它不会尝试加载非工作的休眠状态?有什么建议 会很有帮助

I have an app 'c#' that I am coding on and we ran into a problem. When the app launches it loads an image then loads a second image and begins a mediaelement and a pair of timers. These timers trigger fade events so that the title of the app and then the options appear. However when the  start button on the phone is pressed and then you attempt to relaunch the app from the back button it freezes  and will not continue to load. I know that I should be writting something into Application_Activated to restart the app properly but I am not able to find out what I would need to enter. Is it possible to have it launch the 'public void' that we are  using to start the app so that it doesn't try to load the non working dormant state? Any suggestions would be very helpful

科林

推荐答案

嗨科林,

您可能需要在用户按下开始"按钮时保存应用程序状态;在进入休眠状态和后来成为逻辑删除状态之前,请在应用程序停用"事件中保存您的状态.您可能需要维护状态变量 可以跟踪手机的确切状态,并考虑到待处理的计时器等.然后,在您的应用恢复后,您可以设置一个case语句,以检查状态变量并执行将应用恢复到正常工作状态所需的操作 状态.

You will likely need to save app state at the time the user presses the Start button; save your state at the Application Deactivated event just before going into the dormant, and later tombstoned state. You may need to maintain a state variable that keeps track of the exact state of your phone, that takes into account pending timers etc. Then upon resume of your app you can set up a case statement that inspects the state variable and drives the action needed to restore your app to a valid working state.

更多信息:
Windows Phone的执行模型概述

More info:
Execution Model Overview for Windows Phone

-马克


这篇关于已保存状态问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆