You can catch all unhandled exceptions from the App.xaml.cs class where you are signing the UnhandledException event in the constructor:
public App() { InitializeComponent(); UnhandledException += OnUnhandledException; } protected override void OnUnhandledException(object sender, UnhandledExceptionEventArgs e) {
The e.Handled=true line e.Handled=true prevent your application from crashing, but it is not recommended to use it, because it is likely that your application will no longer be in a healthy state after an exception occurs.
In my projects, I use Google Analytics to log all of my exceptions.
source share