Reputation: 4443
I am creating design app where users can drag and drop controls to some surface. Some controls in toolbar can contains broken logic and generate exceptions when injected to the surface. I would like to suppress some unhandled exception comming from the 3rd party controls when they are dropped.
I want to suppress this UI exception and show some kind of popup:
workArea.Dispatcher.UnhandledException += MainContainerDispatcherUnhandledException
Is is possible to handle and suppress based on the source of origin?
Thanks.
Upvotes: 0
Views: 1241
Reputation: 5159
It is necessary to hadle the event: e.Handled=true;
. DispatcherUnhandledExceptionEventArgs.Handled. Unhandled Exception Handler For WPF Applications
Upvotes: 1
Reputation: 62265
You can make use of AppDomain.UnhandledException and in case you recieve it, identify the control that made it happen, and
Hope this helps.
Upvotes: 1