views:

201

answers:

1

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

Is there a way to cancel later that BeginInvoke method?

Thanks

+3  A: 

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