Skip to content

Commit 1ec9f42

Browse files
committed
feat: windowShake add null check
1 parent 58c3771 commit 1ec9f42

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/WPFDevelopers.Shared/Core/Helpers/ControlsHelper.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ public static void WindowShake(Window window = null)
2525
if (window == null)
2626
if (Application.Current != null && Application.Current.Windows.Count > 0)
2727
window = Application.Current.Windows.OfType<Window>().FirstOrDefault(o => o.IsActive);
28-
28+
if (window == null)
29+
return;
30+
if (window.WindowState != WindowState.Normal)
31+
return;
2932
var doubleAnimation = new DoubleAnimation
3033
{
3134
From = window.Left,

0 commit comments

Comments
 (0)