私はWindowsPhoneアプリケーションを構築しています(基本的にはゲームですが、XNAを使用していません。Silverlightで十分でした)。グラフィックはDispatcherTimerに基づいて移動しています。私がやりたいのは、基本的には電話がかかってきたらタイマーを止め、電話が終わったらタイマーを再開して、ゲームの状態が失われないようにすることです。
私はで試しました:
// 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();
}
しかし、それは機能しませんでした、電話が電話に到着したとき、それは実際にはこの時点に到達しません。誰もがそのような経験をしましたか?
前もって感謝します :)