Windows phone 7 计时器并保存其状态
我正在构建一个windows phone应用程序(基本上是一个游戏,但我没有使用XNA,Silverlight就足够了)。图形正在基于Dispatchermer移动。我想做的基本上是,当电话到达时停止计时器,在电话结束后再次启动计时器,这样游戏状态就不会丢失 我试过:Windows phone 7 计时器并保存其状态,windows-phone-7,state,dispatchertimer,Windows Phone 7,State,Dispatchertimer,我正在构建一个windows phone应用程序(基本上是一个游戏,但我没有使用XNA,Silverlight就足够了)。图形正在基于Dispatchermer移动。我想做的基本上是,当电话到达时停止计时器,在电话结束后再次启动计时器,这样游戏状态就不会丢失 我试过: // Code to execute when the application is activated (brought to foreground) // This code will not execute
// Code to execute when the application is activated (brought to foreground)
// This code will not execute when the application is first launched
private void Application_Activated(object sender, ActivatedEventArgs e)
{
Game.timer.Start();
}
// Code to execute when the application is deactivated (sent to background)
// This code will not execute when the application is closing
private void Application_Deactivated(object sender, DeactivatedEventArgs e)
{
Game.timer.Stop();
}
但是它不起作用,当一个电话打到手机上时,它实际上没有达到这一点。有人有过这样的经历吗
提前感谢:)当接到电话时,您将收到相框上的
请注意,此事件也可以仅因接到一个电话而触发。。非常感谢你!