Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Exception handler not being invoked
- public partial class Window1 : Window
- {
- public Window1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, RoutedEventArgs e)
- {
- new Thread(() =>
- {
- Dispatcher.CurrentDispatcher.UnhandledExceptionFilter += Dispatcher_UnhandledExceptionFilter;
- doer();
- }).Start();
- }
- void Dispatcher_UnhandledExceptionFilter(
- object sender,
- DispatcherUnhandledExceptionFilterEventArgs e)
- {
- MessageBox.Show("FILTER REACHED");
- }
- private void doer()
- {
- throw new NotImplementedException();
- }
- }
- new Thread(() =>
- {
- Dispatcher.CurrentDispatcher.UnhandledExceptionFilter += Dispatcher_UnhandledExceptionFilter;
- Dispatcher.Invoke(new Action(()=>doer()));
- }).Start();
- new Thread(() =>
- {
- Dispatcher.CurrentDispatcher.UnhandledExceptionFilter += Dispatcher_UnhandledExceptionFilter;
- Dispatcher.CurrentDispatcher.Invoke(DispatcherPriority.Normal, new ThreadStart(delegate
- {
- doer();
- }));
- }).Start();
Add Comment
Please, Sign In to add comment