Answered by:
How to Terminate Metro Style Apps on Button Click

Question
-
Hi
I want exit(terminate) my metro style application on Button Click event.
Ravi Shankar
Wednesday, June 27, 2012 12:48 PM
Answers
-
As Tim says, the Windows 8 app certification requirements prohibit this:
3.6 Your app must use the mechanisms provided by the system for those features that have them
...
Your app must neither programmatically close nor offer UI affordances to close it. Windows 8 Process Lifetime Management closes Metro style apps automatically.- Proposed as answer by Can Bilgin Wednesday, June 27, 2012 4:11 PM
- Marked as answer by Min ZhuMember Friday, July 6, 2012 8:40 AM
Wednesday, June 27, 2012 3:56 PMModerator
All replies
-
@Ravi - we would prefer that you don't do this. Apps follow the application lifecycle and when the user is no longer using the app, it enters suspended state. instead of terminating your app, you should just ensure you handle the suspend/resume states. See http://blogs.msdn.com/b/windowsappdev/archive/2012/04/10/managing-app-lifecycle-so-your-apps-feel-quot-always-alive-quot.aspx
Tim Heuer | Program Manager, XAML | http://timheuer.com/blog | @timheuer
(if my post has answered your question, please consider using the 'mark as answer' feature in the forums to help others)- Proposed as answer by Horizon_Net Wednesday, June 27, 2012 4:33 PM
Wednesday, June 27, 2012 2:07 PM -
How about Application.Current.Exit() ? (and possibly Window.Current.Close() before that)
Can Bilgin
Blog CompuSightWednesday, June 27, 2012 2:13 PM -
As Tim says, the Windows 8 app certification requirements prohibit this:
3.6 Your app must use the mechanisms provided by the system for those features that have them
...
Your app must neither programmatically close nor offer UI affordances to close it. Windows 8 Process Lifetime Management closes Metro style apps automatically.- Proposed as answer by Can Bilgin Wednesday, June 27, 2012 4:11 PM
- Marked as answer by Min ZhuMember Friday, July 6, 2012 8:40 AM
Wednesday, June 27, 2012 3:56 PMModerator