简体   繁体   中英

How do I add a Global Exception handler to a Metro Style App?

Is there any specific way to add a global exception handler to a Metro style app, just like LittleWatson in WP7 in the App.Xaml.cs file? what is the best practice and pattern to handle this?

The UnhandledException event page explains why your exception is not handled by that (emphasis mine):

This event is only used with exceptions encountered by the XAML framework . Exceptions encountered by other Windows Runtime components or parts of the application that are not connected to the XAML framework will not result in this event being raised.

It goes on explaining that you should catch exceptions at the most specific time possible. As far as I know, there's no such thing as a global event handler in Windows 8 style apps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM