Reputation: 369
I'm new to Win 8 Metro application development, and discovered that lots of things seem to be changed from the classic WPF.
What troubles me the most is that there's no way to close the app. This is extremely annoying when it comes to debugging the app. Therefore I'm looking at ways to add a "close" button in my app.
However, the old WPF way of:
Application.Current.Shutdown()
no longer exists. And I couldn't find the Process
class in System.Diagnostics
any more.
Does anyone know how to do this?
Upvotes: 31
Views: 7233
Reputation: 3592
I used crash code to exit Windows 8 Metro APP. char *p = nullptr; *p = 1;
Upvotes: -3
Reputation: 6002
The WinRT reference documentation for the developer preview states that:
CoreApplication.Exit | exit method
Shuts down the app.
Upvotes: 4
Reputation: 2141
As far as I know you can't close a Metro app (by design) (using the Task-Manager is the only option that works) and as far as I know there is no way to exit a Metro app programatically (by design too).
You could try to throw an unhandled exception (I wouldn't recommend that).
Upvotes: 0