7

In WPF, I am calling This.Dispatcher.BeginInvoke(DispatcherPriority.SystemIdle, mydelegete);

Is there a way to cancel later that BeginInvoke method?

Thanks

Ghassan Karwchan
  • 3,355
  • 7
  • 37
  • 65

1 Answers1

12

Dispatcher.BeginInvoke returns a DispatcherOperation object. If you retain a reference to it, you can use its Abort method to dequeue the operation if it hasn't started executing yet.

Pavel Minaev
  • 99,783
  • 25
  • 219
  • 289