Beispiel #1
0
        async Task OnDocumentClosing(DocumentCloseEventArgs args)
        {
            try {
                if (DocumentClosing != null)
                {
                    foreach (var handler in DocumentClosing.GetInvocationList().Cast <DocumentCloseAsyncEventHandler> ())
                    {
                        await handler(this, args);

                        if (args.Cancel)
                        {
                            break;
                        }
                    }
                }
            } catch (Exception ex) {
                LoggingService.LogError("Exception before closing documents", ex);
            }
        }
Beispiel #2
0
 Task OnWindowClosing(object sender, DocumentCloseEventArgs args)
 {
     return(OnDocumentClosing(args));
 }
        async Task DontClose(object s, DocumentCloseEventArgs e)
        {
            await Task.Delay(100);

            e.Cancel = true;
        }