SystemNavigationManagerPreview.CloseRequested SystemNavigationManagerPreview.CloseRequested SystemNavigationManagerPreview.CloseRequested SystemNavigationManagerPreview.CloseRequested SystemNavigationManagerPreview.CloseRequested Event

Definition

Occurs when the user invokes the system button for close (the 'x' button in the corner of the app's title bar).

public : event EventHandler<SystemNavigationCloseRequestedPreviewEventArgs> CloseRequested
// Register
event_token CloseRequested(EventHandler<SystemNavigationCloseRequestedPreviewEventArgs> const& handler) const;

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

// Revoke with event_revoker
CloseRequested_revoker CloseRequested(auto_revoke_t, EventHandler<SystemNavigationCloseRequestedPreviewEventArgs> const& handler) const;
public event EventHandler<SystemNavigationCloseRequestedPreviewEventArgs> CloseRequested
Public Event CloseRequested As EventHandler (Of SystemNavigationCloseRequestedPreviewEventArgs)
function onCloseRequested(eventArgs){/* Your code */}


systemNavigationManagerPreview.addEventListener("closeRequested", onCloseRequested);
systemNavigationManagerPreview.removeEventListener("closeRequested", onCloseRequested);

Remarks

ClosedRequested events will not be raised for windows that are non-visible. For example an application window that is minimised but not suspended (multi-window, or with an active extended execution request) will not be closed or receive this event until the window is made visible by the user. Also in Tablet Mode the event will not be raised and the window will be closed when the user drags the window to the bottom of the screen. In all cases apps are expected to save user data when the app receives a suspend notification in case it never is woken again to save data.