Share via

AppWindow.Closing Event


Occurs when a window is being closed through a system affordance.

// Register
event_token Closing(TypedEventHandler<AppWindow, AppWindowClosingEventArgs const&> const& handler) const;

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

// Revoke with event_revoker
AppWindow::Closing_revoker Closing(auto_revoke_t, TypedEventHandler<AppWindow, AppWindowClosingEventArgs const&> const& handler) const;
public event TypedEventHandler<AppWindow,AppWindowClosingEventArgs> Closing;
function onClosing(eventArgs) { /* Your code */ }
appWindow.addEventListener("closing", onClosing);
appWindow.removeEventListener("closing", onClosing);
- or -
appWindow.onclosing = onClosing;
Public Custom Event Closing As TypedEventHandler(Of AppWindow, AppWindowClosingEventArgs) 

Event Type


This event does not occur when the AppWindow.Destroy method is called.

Applies to

See also