Skip to content

Commit d8dbe56

Browse files
committed
When parent window cannot be found the paired snackbar is still available. This can occur if the Snackbar is hosted outside of a WPF Window such as in a WinForms application.
Fixes #946
1 parent 2740f14 commit d8dbe56

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

MaterialDesignThemes.Wpf/SnackbarMessageQueue.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ private DispatcherOperation<Snackbar> FindSnackbar(Dispatcher dispatcher)
328328
{
329329
if (!sb.IsLoaded || sb.Visibility != Visibility.Visible) return false;
330330
var window = Window.GetWindow(sb);
331-
return window != null && window.WindowState != WindowState.Minimized;
331+
return window?.WindowState != WindowState.Minimized;
332332
});
333333
});
334334
}

0 commit comments

Comments
 (0)