question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Freeze exception on DropShadowEffect when opening a contextmenu

See original GitHub issue

Describe 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:closed
  • Created 3 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
gordon771commented, Oct 13, 2020

Hi @timunie and @punker76,

I made the sample repro public.

Thanks again for your effort!

Best regards, Gordon

0reactions
gordon771commented, Oct 20, 2020

Hi @punker76 ,

okay, that was my workaround so far.

Thank you for your answer and your effort!

Best regards, Gordon

Read more comments on GitHub >

github_iconTop 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 >
Exception Class | Spread Windows Forms 15.0
Represents an exception.
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found