I just learnt that terminating the app in the code is not recommended, but how do I suspend an app in the click event of a button? I have a Close button in my app when clicked, should suspend the app. I don’t want the user to hit ALT+f4 or anything. When the user clicks the app icon again from the Start icon, it should resume the app. How do I do it?
I’m looking for something like –
private void btnSuspend_Click(object sender, RoutedEventArgs e)
{
//Suspend App.
}
An app cannot suspend itself. Windows manages the lifetime of Windows Store apps automatically. An app will be suspended after a timeout of approximately ten seconds when it is no longer visible, or when the machine goes into a low power state. When the user reactivates the app again (through Start, Alt-Tab, etc.) Windows will resume the app.