コード例 #1
0
        private static async Task PerformClosingOperationsAsync(Window window)
        {
            _isClosingConfirmed = await ExecuteClosingAsync(watcher => watcher.PrepareClosingAsync()).ConfigureAwait(false);

            if (!_isClosingConfirmed)
            {
                return;
            }

            _isClosingConfirmed = await ExecuteClosingAsync(watcher => watcher.ClosingAsync()).ConfigureAwait(false);

            if (_isClosingConfirmed)
            {
                await DispatcherService.InvokeAsync(window.Close).ConfigureAwait(false);
            }
            else
            {
                NotifyClosingCanceled();
            }
        }
コード例 #2
0
 private static async Task CloseWindow(Window window)
 {
     IsClosingConfirmed = true;
     await DispatcherService.InvokeAsync(window.Close).ConfigureAwait(false);
 }