From 837a8ad04e9c2421b9d218d94c65e0f6e56759f2 Mon Sep 17 00:00:00 2001 From: lwq Date: Thu, 26 Nov 2020 13:46:18 +0800 Subject: [PATCH] fixd using FatalGlobal not in dispather caused attempt to access control and throw an UnvalidOprationException --- .../HandyControl_Shared/Controls/Growl/Growl.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Shared/HandyControl_Shared/Controls/Growl/Growl.cs b/src/Shared/HandyControl_Shared/Controls/Growl/Growl.cs index 19f4ee51..0e1842a6 100644 --- a/src/Shared/HandyControl_Shared/Controls/Growl/Growl.cs +++ b/src/Shared/HandyControl_Shared/Controls/Growl/Growl.cs @@ -485,7 +485,19 @@ namespace HandyControl.Controls growlInfo.IconBrushKey = ResourceToken.PrimaryTextBrush; growlInfo.StaysOpen = true; growlInfo.ShowCloseButton = false; - if (GrowlPanel.ContextMenu != null) GrowlPanel.ContextMenu.Opacity = 0; + Application.Current.Dispatcher?.Invoke( +#if NET40 + new Action( +#endif + () => + { + if (GrowlPanel.ContextMenu != null) GrowlPanel.ContextMenu.Opacity = 0; + } + +#if NET40 + ) +#endif + ); } else {