如何检测用户是否关闭了 winrt 应用程序 [英] How to detect if a user has closed a winrt application

查看:22
本文介绍了如何检测用户是否关闭了 winrt 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

检测用户是否使用 ALT-F4 或关闭手势关闭应用的可靠(且立即)方法是什么?

What is a reliable (and immediately) way to detect if a user has closed the app with ALT-F4 or the close-gesture?

推荐答案

根据 应用程序生命周期 文档无法检测到此事件(请参阅应用程序关闭"下的部分).使用 ApplicationData 可以最好地管理这种类型的状态 类.

According to the Application Lifecycle documentation there is no way to detect this event (See the section under "App close"). This type of state can be managed best using the ApplicationData class.

这篇关于如何检测用户是否关闭了 winrt 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆