Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

programmatically close win8 app

I've begun tinkering with making windows 8 apps And I want to make an exit button.

The problem is that Environment.Exit() and this.Close() that I'd use in winforms isn't in scope here.

anyone know how to close the app Programmatically?

like image 464
Sam I am says Reinstate Monica Avatar asked Oct 05 '12 16:10

Sam I am says Reinstate Monica


2 Answers

Application.Current.Exit();

But closing a Metro app is not recommended. It is usually suspended.

like image 128
tempid Avatar answered Sep 22 '22 07:09

tempid


Application.Exit

But be careful. You can fail certification by having code which forcefully closes the App. Make sure to read up on Certification Guidance if you plan to release to the store:

Your app must neither programmatically close nor offer UI affordances to close it. Windows 8 Process Lifetime Management closes Windows Store apps automatically.

like image 37
J. Tanner Avatar answered Sep 21 '22 07:09

J. Tanner