Freeze exception on DropShadowEffect when opening a contextmenu
See original GitHub issueDescribe the bug
I get the exception: System.Windows.Markup.XamlParseException: ‘Cannot access Freezable ‘System.Windows.Media.Effects.DropShadowEffect’ across threads because it cannot be frozen.’ when opening a context menu.
I am using several MetroWindows dialogs, each has his own dialog thread, instanciated as thread.SetApartmentState(ApartmentState.STA).
Steps to reproduce
Exception occurres when in one dialog a menu or context menu is openend and afterwards in a different dialog a context menu is trying to be opened.
Actual behavior
This exception did not occur with MahApps version V1.6.4.
Turning off drop shadow with “HasDropShadow=False” on context menu did not improve the situation.
Environment
MahApps.Metro version: v2.0.0
Windows build number: Win10 1909 [Version 10.0.18363.836]
Visual Studio: 2019 16.6.0
Target Framework: .Net Core 3.1 (v4.5.2, v4.7.2)
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
WPF overriding ContextMenu style - DropShadowEffect not ...
I want to override the ContextMenu 's style. Here's my style: <SolidColorBrush x:Key="WindowBackgroundBrush" Color="#E7E8EC" ...
Read more >MahApps.Metro changelog - Awesome .NET - LibHunt
#3935 Freeze exception on DropShadowEffect when opening a contextmenu; #3931 TimePicker reset on clock/popup click; #3929 GetWindowText: Win32Exception On ...
Read more >[JDK-8093129] NullPointerException in ContextMenuContent ...
The following is happening since Java 8u20. It happens in our application, when we display a nested menu in a ContextMenu. I've tried...
Read more >Fixed issues in After Effects versions 17.x and later
Fixed an issue that caused After Effects to crash when converting the PSD text layer to editable text through the layer timeline context...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @timunie and @punker76,
I made the sample repro public.
Thanks again for your effort!
Best regards, Gordon
Hi @punker76 ,
okay, that was my workaround so far.
Thank you for your answer and your effort!
Best regards, Gordon