AppWindow.CloseRequested 事件

定义

在窗口开始关闭之后、关闭之前以及关闭事件之前发生。

// Register
event_token CloseRequested(TypedEventHandler<AppWindow, AppWindowCloseRequestedEventArgs const&> const& handler) const;

// Revoke with event_token
void CloseRequested(event_token const* cookie) const;

// Revoke with event_revoker
AppWindow::CloseRequested_revoker CloseRequested(auto_revoke_t, TypedEventHandler<AppWindow, AppWindowCloseRequestedEventArgs const&> const& handler) const;
public event TypedEventHandler<AppWindow,AppWindowCloseRequestedEventArgs> CloseRequested;
function onCloseRequested(eventArgs) { /* Your code */ }
appWindow.addEventListener("closerequested", onCloseRequested);
appWindow.removeEventListener("closerequested", onCloseRequested);
- or -
appWindow.oncloserequested = onCloseRequested;
Public Custom Event CloseRequested As TypedEventHandler(Of AppWindow, AppWindowCloseRequestedEventArgs) 

事件类型

注解

重要

仅当应用具有应用关闭确认受限功能 () <rescap:Capability Name="confirmAppClose"/> 时,才会发生此事件,因此它不适用于大多数应用。 有关详细信息,请参阅 应用功能声明 - 受限功能

适用于

另请参阅