[英]Execute code when exiting Windows 8.1 App
I'm attempting to execute some code on my Windows 8.1 app on exit, when a user drags the app down normally (not the extended hold to terminate). 我试图在退出时在Windows 8.1应用程序上执行一些代码,当用户正常向下拖动应用程序(而不是扩展保留来终止)时。
In Windows 8, I used the following code to clear the app's tile on exit:- 在Windows 8中,我使用以下代码在退出时清除了应用的磁贴:-
private async void OnSuspending(object sender, SuspendingEventArgs e)
{
Windows.UI.Notifications.TileUpdateManager.CreateTileUpdaterForApplication().Clear();
}
However, this code isn't called in Windows 8.1 when the way the app terminate changes. 但是,当应用终止方式更改时,Windows 8.1中不会调用此代码。
How do I recreate my code for Windows 8.1? 如何为Windows 8.1重新创建代码?
In 8.1, the close gesture no longer kills the app. 在8.1中,关闭手势不再会杀死应用程序。 Instead you have to hold it at the button for 1 second and when the icons flips , the app is closed.
相反,您必须将其在按钮上按住1秒钟,然后在图标翻转时关闭应用程序。
Look if the code is executed there. 查看代码是否在此处执行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.