programmatically close win8 app

假装没事ソ 提交于 2019-12-07 01:07:49

问题


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?


回答1:


Application.Current.Exit();

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




回答2:


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.




回答3:


Application.Current.Exit();

This was not allowed, but requirement 3.6, which used to not allow this, seems to be removed : http://msdn.microsoft.com/en-us/library/windows/apps/hh694083.aspx#acr_changelog



来源:https://stackoverflow.com/questions/12749990/programmatically-close-win8-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!