退出Windows Phone App 7.1 [英] Exit from Windows Phone App 7.1

查看:103
本文介绍了退出Windows Phone App 7.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想在Windows Phone App 7.1中编写退出功能。我试过了NavigationService.GoBack()正如文章你的第一个Windows Phone 7应用程序只需几次击键就可以了 [ ^ ]但它不起作用。请给出一个解决方案。

Hi,
I want to code exit functionality in Windows Phone App 7.1. I have tried NavigationService.GoBack() As given in an article Your first Windows Phone 7 App is just a few keystrokes away[^] but it is not working. Please give a solution.

推荐答案

您可以随时在登录页面上调用退出。单击应用程序后退按钮使用此代码:

You can always call an exit by doing this at your landing page.Use this code on click of your application back button:
if (NavigationService.CanGoBack)
{
    while (NavigationService.RemoveBackEntry() != null)
    {
        NavigationService.RemoveBackEntry();
    }
}



这将删除堆栈中的条目,如果您按下后退按钮,它将关闭应用程序,没有任何例外。



更新:

有几种方式..

1。 http://www.bauer-martin。 com / csharp / windows-phone-7-exit-application-on-back-button-796.html [ ^ ]

2. http://mobile.dzone.com/articles/windows-phone-mango-sample-3 [< a href =http://mobile.dzone.com/articles/windows-phone-mango-sample-3target =_ blanktitle =New Window> ^ ]

3. http://堆overflow.com/questions/3993507/is-there-a-way-to-programmatically-quit-my-app-windows-phone-7 [ ^ ]

Link 2对此有一个简短的解释。希望能帮助你.. :)


This will remove back entries from the stack, and if you will press a back button it will close the application without any exception.

Update:
A couple of ways..
1.http://www.bauer-martin.com/csharp/windows-phone-7-exit-application-on-back-button-796.html[^]
2.http://mobile.dzone.com/articles/windows-phone-mango-sample-3[^]
3.http://stackoverflow.com/questions/3993507/is-there-a-way-to-programmatically-quit-my-app-windows-phone-7[^]
Link 2 has a brief explanation on this regard.Hope that will help you..:)


这篇关于退出Windows Phone App 7.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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