The DispatcherOperation object returned by BeginInvoke has a Completed event on it. Subscribe to this to complete operations after completion:
var dispatcherOp = Dispatcher.BeginInvoke( /* your method here */); dispatcherOp.Completed += (s, e) => { /* callback code here */ };
The likelihood that the operation will complete before signing, so you can check the Status property to complete after:
if (dispatcherOp.Status == DispatcherOperationStatus.Completed) { ... }
It is also possible that the operation will be aborted, so processing / testing for Aborted may also be appropriate.
dlev
source share