diff --git a/src/App.xaml.cs b/src/App.xaml.cs index 35d2662..e3fc397 100644 --- a/src/App.xaml.cs +++ b/src/App.xaml.cs @@ -146,10 +146,14 @@ private void StartShowWindowListener() { while (!_cancellationTokenSource.Token.IsCancellationRequested) { - if (_showWindowEvent.WaitOne(1000)) + if (_showWindowEvent == null) + { + await Task.Delay(1000); + } + else if (_showWindowEvent.WaitOne(1000)) { _showWindowEvent.Reset(); - + await Dispatcher.InvokeAsync(() => { try