jxbma
asked on
How do I handle unhandled Application level exceptions in a WPF application?
Hi:
I'm migrating an existing Winforms based application to WPF.
For handling unhandled exceptions at the application level in my Winforms app, I did the following:
// Added for application level error handling
Application.ThreadExceptio n += new ThreadExceptionEventHandle r(Applicat ion_Thread Exception) ;
// This is a delegate! That is a user method inside the parens
AppDomain.CurrentDomain.Un handledExc eption += new UnhandledExceptionEventHan dler(Curre ntDomain_U nhandledEx ception);
// This is a delegate! That is a user method inside the parens
Application.SetUnhandledEx ceptionMod e(Unhandle dException Mode.Catch Exception) ;
How do I go about handling these conditions in a WPF based application?
Thanks,
JohnB
I'm migrating an existing Winforms based application to WPF.
For handling unhandled exceptions at the application level in my Winforms app, I did the following:
// Added for application level error handling
Application.ThreadExceptio
// This is a delegate! That is a user method inside the parens
AppDomain.CurrentDomain.Un
// This is a delegate! That is a user method inside the parens
Application.SetUnhandledEx
How do I go about handling these conditions in a WPF based application?
Thanks,
JohnB
ASKER
OK. This is what I was doing in my Winforms app.
How would I handle exceptions thrown within threads (either my own, or spun from 3rd party libraries)?
Thanks,
JohnB
How would I handle exceptions thrown within threads (either my own, or spun from 3rd party libraries)?
Thanks,
JohnB
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Michael
Open in new window