简体   繁体   English

退出Windows 8.1应用时执行代码

[英]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.

相关问题 在Windows Phone 8.1上退出GridView的重新排序模式时发生的事件 - Event when exiting GridView's reorder mode on Windows Phone 8.1 退出VisualStudio调试器时执行代码 - Execute code when VisualStudio debugger is exiting 应用未运行Windows Phone 8.1时的RawPushNotification - RawPushNotification when app not running Windows Phone 8.1 Windows Phone 8.1 ListView元素在绑定后执行代码 - Windows Phone 8.1 ListView element execute code after bind windows phone 8.1 从应用程序执行后台任务(计时器) - windows phone 8.1 execute backgroundtask from app (timertrigger) 通用Windows应用商店应用关闭时如何执行代码? - How to execute code when Universal Windows Store App is closing? 如何在Windows Phone 8.1应用程序中扫描QR码? (不是silverlight app)? - How to scan a QR code in a Windows Phone 8.1 App? (not silverlight app)? 在Windows Phone 8.1应用中单击本地通知时,应用未打开? - App is not open when local notification click in windows phone 8.1 app? 如何在Windows Phone 8.1应用程序开发中读取QR码? - How to read QR code in windows phone 8.1 app development? 从商店下载Windows Phone 8.1应用程序时崩溃 - Windows Phone 8.1 app crashes when downloaded from store
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM