c# - WPF custom error-handling dialog box? -


I am trying to install my WPF application so that when an exception fails, an error dialogue appears Will go Good ol 'was possible by adding it to WinForms

  Application.ThreadException + = New system. threading. Thread Expanded Event Handler (Application_ThreadException);  

In the program.cs file and then the event handling code is showing the dialog that you wanted. In WPF I

  app Have tried to use the Dispter. Unknown Exception + = New System Windows threading. DisasterAnaldedDevelopmentEventsHandler (Dispatcher_unknown exception);  

However, when I use custom window () to deal with my error, the application immediately "blahblah.exe has stopped working ..." and has stopped. If I use ShowDialog (), the window is usable until it is closed and then "... stopped working ..." dialog pops up and dies .

In WinForms, it seems that anybody will allow the error dialogue app to continue running, depending on how serious the exception is. I do not seem to understand how to do this properly in WPF.

Any thoughts?

You must set the handle on the right in EventArgs.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -