fixd using FatalGlobal not in dispather caused attempt to access control and throw an UnvalidOprationException

This commit is contained in:
lwq committed 2020-11-26 13:46:18 +08:00
1 parent e99f1fe429
commit 837a8ad04e
1 file changed
+12
@@ -485,8 +485,20 @@ namespace HandyControl.Controls
growlInfo.IconBrushKey = ResourceToken.PrimaryTextBrush; growlInfo.IconBrushKey = ResourceToken.PrimaryTextBrush;
growlInfo.StaysOpen = true; growlInfo.StaysOpen = true;
growlInfo.ShowCloseButton = false; growlInfo.ShowCloseButton = false;
Application.Current.Dispatcher?.Invoke(
#if NET40
new Action(
#endif
() =>
{
if (GrowlPanel.ContextMenu != null) GrowlPanel.ContextMenu.Opacity = 0; if (GrowlPanel.ContextMenu != null) GrowlPanel.ContextMenu.Opacity = 0;
} }
#if NET40
)
#endif
);
}
else else
{ {
growlInfo.IconKey ??= ResourceToken.FatalGeometry; growlInfo.IconKey ??= ResourceToken.FatalGeometry;