2

I know that one can use MSApp.terminateApp to kill the application. What about restarting an app? Is there any command for restarting?

4

1 に答える 1

2

Restarting does not fit within the Windows 8 Application concept (formerly metro). If you get into an unrecoverable state then the appropriate thing to do is let it crash and let windows handle it from there.

From here:

App crash

Apps are required to follow the system crash experience, which is to simply return to the Start screen. The system crash experience is designed to get users back to what they were doing as quickly as possible, so you shouldn't provide a warning dialog or other notification because that'll cause a delay for the user. The disappearance of the app should make it clear to the user that something went wrong.

If your app crashes, stops responding, or generates an exception, Windows asks the user for consent to send a problem report to Microsoft. Microsoft provides a subset of the error data in the problem report to you so that you can use it to improve your app. You'll be able to see this data in your app's Quality page in your Dashboard in the Windows Dev Center for Metro style apps. (Note that you can't submit apps or view your app's data until the Windows Store opens for general submissions.)

When the user activates an app after it crashes, its activation event handler receives an ApplicationExecutionState value of NotRunning, and should simply display its initial UI and data.

于 2012-08-15T02:34:23.363 に答える