退出应用程序 - Windows Phone认证

时间:2013-03-12 04:48:04

标签: windows-phone-7

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

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

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

2 个答案:

答案 0 :(得分:3)

这样做不应该破坏正常的应用程序流程。用户希望通过按后退按钮或Windows键来关闭应用程序。用户可能还希望通过Fast App Switching恢复应用程序工作。

此外,您的方法不会退出应用程序,因为您将在某一时刻点击主页面,它无法返回。之后,将无法进行后退。

底线:不要这样做。

Peter Torr的一个很好的解释是here

答案 1 :(得分:1)

在我的一个应用程序中,我的任务是在用户重置他/她的帐户时退出。该应用程序在商店,所以没有问题。我相信你可以使用这段代码退出,这样就可以了:

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

只需添加对Microsoft.Xna.Framework.Game

的引用即可

look at this link

  

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.

例如,您只需要一条消息,因此需要退出

相关问题