Windows Phone 7 关闭应用程序 [英] Windows Phone 7 close application

查看:53
本文介绍了Windows Phone 7 关闭应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能以编程方式关闭 Windows Phone 7 上的 Silverlight 应用程序?

Is there any possibility to programatically close Silverlight application on Windows Phone 7?

推荐答案

如果您编写 XNA 游戏,您将可以访问显式的 Exit() 方法.如果您正在编写传统的 Silverlight 项目,那么,没有办法以编程方式关闭您的应用程序.另请参阅 Peter Torr 的在 Windows Phone 7 中退出 Silverlight 应用程序的博客条目.在那里,他还提到了抛出未处理异常的选项,IMO 是一种糟糕的编程风格.

If you write an XNA Game, you will have access to an explicit Exit() method. If you are writing traditional Silverlight project, then NO, there is no way to programatically close your app. See also Peter Torr's Blog entry on Exiting Silverlight Apps in Windows Phone 7. There he also mentions the option of throwing an unhandled exception, which IMO is a terrible programing style.

您可以尝试的一个选项是使用 WP7 导航服务以编程方式导航回应用程序之外.不知道这是否会奏效.为什么你需要退出?

An option you may try, is using the WP7 Navigation Service to programatically navigate back out of the application. Not sure if that would work though. Why do you need to Exit?

这篇关于Windows Phone 7 关闭应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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