private async Task HideAsync() { _isVisible = false; if (_mouseHook.IsHookSet) { _mouseHook.RemoveHook(); } var animation = new DoubleAnimation { To = 0, Duration = TimeSpan.FromMilliseconds(200), EasingFunction = new CubicEase { EasingMode = EasingMode.EaseOut }, }; BeginAnimation(OpacityProperty, animation); _dropShadow.BeginAnimation(WindowDropShadow.OpacityProperty, animation); await Task.Delay((int)animation.Duration.TimeSpan.TotalMilliseconds / 2); WindowBlur.Disable(this); await Task.Delay((int)animation.Duration.TimeSpan.TotalMilliseconds / 2); Hide(); _dropShadow.Hide(); }