Share via


AppWindow.CloseRequested Event

Definition

Occurs after the window starts to close, but before it is closed and before the Closed event occurs.

// 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) 

Event Type

Remarks

Important

This event occurs only when the app has the App Close Confirmation restricted capability (<rescap:Capability Name="confirmAppClose"/>), so it is not applicable to most apps. For more info, see App capability declarations - Restricted capabilities.

Applies to

See also