标签:style blog color os io art ar div
//设置一个DispatcherTimer,控制三秒内再次点击返回键时执行退出逻辑
public void ExitBy2Click(System.ComponentModel.CancelEventArgs e) { if (!IsExit) { IsExit = true; e.Cancel = true; _timer = new DispatcherTimer(); _timer.Start(); SystemTrayMessage.Instance.StartAdv("再按一次退出", 3, false); _timer.Interval = TimeSpan.FromSeconds(3); _timer.Tick += (sender, ee) => { IsExit = false; e.Cancel = false; _timer.Stop(); }; return; } else { while (NavigationService.BackStack.Any()) NavigationService.RemoveBackEntry(); base.OnBackKeyPress(new CancelEventArgs()); // App.Current.Terminate(); //new Microsoft.Xna.Framework.Game().Exit();//wp7 }
windows phone 开发常用小技巧 - 退出应用之升级版(三秒内双击退出),布布扣,bubuko.com
windows phone 开发常用小技巧 - 退出应用之升级版(三秒内双击退出)
标签:style blog color os io art ar div
原文地址:http://www.cnblogs.com/Zhaowh/p/3900497.html