SystemNavigationManagerPreview.CloseRequested Event (Windows.UI.Core.Preview) - UWP app developer

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