以编程方式重新启动 Windows 应用商店应用程序 [英] Restarting Windows Store Apps programmatically

查看:37
本文介绍了以编程方式重新启动 Windows 应用商店应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道可以使用 MSApp.terminateApp 杀死应用程序.重新启动应用程序怎么样?有没有重启的命令?

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

推荐答案

重新启动不适合 Windows 8 应用程序概念(以前称为 Metro).如果您进入无法恢复的状态,那么正确的做法是让它崩溃并让 Windows 从那里处理它.

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.

来自此处:

应用崩溃

应用程序需要遵循系统崩溃体验,即只需返回开始屏幕.系统崩溃的体验是旨在让用户尽快回到他们正在做的事情可能,所以你不应该提供警告对话框或其他通知,因为这会导致用户延迟.这应用程序的消失应该让用户清楚地知道出了点问题.

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.

如果您的应用崩溃、停止响应或产生异常,Windows 要求用户同意将问题报告发送给微软.Microsoft 提供了错误数据的子集问题报告给您,以便您可以使用它来改进您的应用程序.您将能够在应用程序的质量页面中查看此数据Metro 风格应用程序的 Windows 开发人员中心中的仪表板.(注意在 Windows 应用商店之前,您无法提交应用程序或查看您的应用程序数据打开一般提交.)

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.)

当用户在崩溃后激活应用时,其激活事件处理程序接收到 NotRunning 的 ApplicationExecutionState 值,并且应该只显示其初始 UI 和数据.

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.

这篇关于以编程方式重新启动 Windows 应用商店应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆