我正在使用Windows Phone。当我的应用程序停用并进入后台时,我想检测OnNavigatedFrom事件上的应用程序停用,以便在应用程序进入后台时实现一些逻辑。我怎样才能做到这一点?????Windows Phone应用程序停用检测页面
2
A
回答
0
使用下列方法(在App.xaml.cs文件中)时,应用程序被激活或去激活来执行逻辑:
// Code to execute when the application is launching (eg, from Start)
// This code will not execute when the application is reactivated
private void Application_Launching(object sender, LaunchingEventArgs e)
{
}
// 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)
{
}
// 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)
{
}
// Code to execute when the application is closing (eg, user hit Back)
// This code will not execute when the application is deactivated
private void Application_Closing(object sender, ClosingEventArgs e)
{
}
1
我找到了解决自己。将处理程序附加到您导航的页面上的PhoneApplicationService.Current.Deactivated事件。
1
您可以保存从APP事件或页面事件中停用的时间,并将其存储在IsolatedStorage中,然后在您的应用重新激活时(OnNavigatedTo)检索数据。
相关问题
- 1. 暂停应用程序Windows Phone 8.1
- 2. Windows Phone 8应用程序测试
- 3. 多页Windows Phone应用程序
- 4. Windows phone 7应用程序空闲检测
- 5. Windows Phone 7应用程序
- 6. 滚动页面惠斯特为Windows Phone设计应用程序
- 7. 检测页面更改为一个页面应用程序JS
- 8. Windows桌面应用程序可以在Windows Phone上使用吗?
- 9. “Windows Phone应用程序”和“Silverlight for Windows Phone应用程序”有何区别?
- 10. Windows Phone测试框架 - NuGet - 测试新应用程序
- 11. 使用OAuth2的Windows Phone应用程序
- 12. Windows Phone 8.1到通用应用程序
- 13. 用C++开发Windows phone应用程序
- 14. Windows Phone应用程序更新过程
- 15. 从Windows Phone Silverlight应用程序调用winrt api应用程序
- 16. Telerik Test Studio用于自动化测试Windows Phone应用程序
- 17. 隐藏Windows Phone浏览器用户控件后,如何返回到Windows Phone应用程序页面?
- 18. 在Windows Phone 8.1通用应用程序中设置起始页
- 19. 在Windows Phone MVVM应用程序中播放/暂停MP3文件
- 20. 以编程方式更改Windows Phone 7应用程序启动页面
- 21. Windows Phone在应用程序外购买应用程序?
- 22. 如何使用winjs + html在windows phone 8.1应用程序的页面中导航应用程序栏
- 23. Windows Phone 8.0到Windows Phone 8.1应用程序
- 24. Windows Phone应用程序分析的Windows Phone 8 - 开始
- 25. Windows Phone应用程序背景图像
- 26. Windows Phone 8应用程序中的ListView
- 27. Windows Phone应用程序内存消耗
- 28. System.Windows.Browser Windows Phone地图应用程序
- 29. Windows Phone 7隐藏应用程序栏
- 30. 为Windows Phone 7开发应用程序