1

这是退出应用程序的代码。

if (NavigationService.CanGoBack)
{
            while (NavigationService.RemoveBackEntry() != null)
            {
                NavigationService.RemoveBackEntry();
            }
}

谁能告诉我从 Windows Phone 认证要求的角度来看是否允许????

4

2 回答 2

3

您不应该通过这样做来中断正常的应用程序流程。用户希望通过点击后退按钮或 Windows 键来关闭应用程序。用户可能还期望通过快速应用切换来恢复应用程序的工作。

此外,您的方法不会退出应用程序,因为在某一时刻您将访问主页,它无法返回。之后,将无法删除返回条目。

底线:不要这样做。

Peter Torr 的一个很好的解释可以在这里找到

于 2013-03-12T04:59:49.047 回答
1

在我的一个应用程序中,我的任务是在用户重置他/她的帐户时退出。该应用程序在商店中,因此没有问题。我确定您可以使用此代码实现退出,并且可以:

var g = new Microsoft.Xna.Framework.Game();
                    g.Exit();

只需添加参考Microsoft.Xna.Framework.Game

看看这个链接

5.1.2 - 应用关闭

The app must handle exceptions raised by the any of the managed or native System API 
and not close unexpectedly. During the certification process, the app is monitored 
for unexpected closure. An app that closes unexpectedly fails certification. The app
must continue to run and remain responsive to user input after the exception is
handled.

例如,您只需要一条消息,因此预期会出现THE EXIT 。

于 2013-03-12T07:30:11.257 回答