退出Windows 8.1 App时执行代码

时间:2013-10-18 03:00:12

标签: c# windows-8 windows-store-apps windows-8.1

我正在尝试在退出时在我的Windows 8.1应用程序上执行一些代码,此时用户正常拖动应用程序(而不是延迟保留以终止)。

在Windows 8中,我使用以下代码在退出时清除应用程序的磁贴: -

    private async void OnSuspending(object sender, SuspendingEventArgs e)
    {
        Windows.UI.Notifications.TileUpdateManager.CreateTileUpdaterForApplication().Clear();
    }

但是,当应用程序终止更改的方式时,不会在Windows 8.1中调用此代码。

如何为Windows 8.1重新创建代码?

1 个答案:

答案 0 :(得分:0)

在8.1中,关闭手势不再杀死应用程序。 Instead you have to hold it at the button for 1 second and when the icons flips,该应用已关闭。

enter image description here

查看代码是否在那里执行。