0

There is a new API in the Windows 8.1 ApplicationView namespace. The ApplicationView.Consolidated | consolidated event. MSDN

Description: Occurs when the window is removed from the list of recently used apps or if the user executes a close gesture on it.

MSDN docs are a little vague. Is this an API developers can use to detect when their application has been terminated by the user or by the system? What is a scenario to handle this event?

4

1 回答 1

3

合并事件仅由通过 MSApp.createNewView 创建的辅助视图触发,因此不适用于应用程序的主视图 - 也就是说,当主应用程序窗口关闭时不会触发它。它只是为了让整个应用程序知道它的辅助视图之一已关闭。

它在Multiple Views 示例中进行了演示,并且代码中有一些关于此事的冗长评论。

简而言之,当应用程序关闭时,除了挂起之外没有其他事件发生。您可以使用暂停事件来做任何您需要的事情。

于 2013-11-07T17:51:21.813 回答