Hi,
I have a DispatcherUnhandledException handler in Application.xaml.vb which should simply display an error message to the user, and after the user presses OK, shutdown the application. Code:
Thanks,
Michel
I have a DispatcherUnhandledException handler in Application.xaml.vb which should simply display an error message to the user, and after the user presses OK, shutdown the application. Code:
Private Sub GeneralExceptionHandler(ByVal sender As Object, ByVal e As DispatcherUnhandledExceptionEventArgs)
ClosingAfterException = True
MessageBox.Show("Exception: " + e.Exception.Message, "Fatal Error", MessageBoxButton.OK)
MyBase.Shutdown()
e.Handled = True
End Sub
The message box does display, but only for a fraction of a second. It doesn't wait for the user to press OK. I tried a sample from MSDN which does something like this and the message box does stick around for the user to click on the button. Any idea as to what could be causing this behavior?Thanks,
Michel