Ghassan Karwchan
Ghassan Karwchan

Reputation: 3530

Cancel BeginInvoke in WPF

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

Is there a way to cancel later that BeginInvoke method?

Thanks

Upvotes: 7

Views: 3676

Answers (1)

Pavel Minaev
Pavel Minaev

Reputation: 101555

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.

Upvotes: 12

Related Questions