Another way to close Windows Phone application from code
Correction
In my previous post on how to terminate the Windows Phone application i proposed a solution that is not really in accordance with Windows Phone Marketplace Technical Cerification Requirements (see requirement 5.1.2):
” An application that closes unexpectedly fails certification. ”
Even though I’m pretty sure that this requirement is not enforced since my apps use this approach and they were never rejected i decided to present another way.
Some good people suggested in comments of my previous post that you can terminate current application simply by calling the XNA Game class Exit method like this:
using Microsoft.Xna.Framework;
namespace Roboblob
{
public class AppLifetimeHelper
{
public void CloseApplication()
{
new Game().Exit();
}
}
}
The downside of this is that you need to add 2 XNA dll’s to your project:
- Microsoft.Xna.Framework
- Microsoft.Xna.Framework.Game
This entry was posted by roboblob on August 21, 2012 at 17:17, and is filed under Mobile, Navigation, Offline Browser, Programming, Windows Phone. Follow any responses to this post through RSS 2.0.You can leave a response or trackback from your own site.
- Dot Net Gotcha #2 – Loop variables and Closures
- Dot Net Gotcha #1 – List versus Collection constructor
- How to terminate your Windows Phone application programmatically?
- Using Instapaper and other Mobilizer services in Offline Browser for Windows Phone
- Throttling Immediate TextBox Binding Behavior for Windows Phone
- Using Offline Browser for Windows Phone as Instapaper client
- Offline Browser for Windows Phone is released
- Why I think Windows Phone is superior phone OS?
- Combining Silverlight Navigation Framework and Prism to create MVVM Applications – Introduction