-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Freeze exception on DropShadowEffect when opening a contextmenu #3935
Comments
HI @gordon771 would it be possible for you to share a sample App showing the issue? Would be best if you could create a repro on github for it. Thank you and happy coding |
Hi @timunie many thanks for your effort. I setup a repository for you with sample code. There are 3 branches: main branch with described bug (open app -> open window 1 from pulldown menu -> open context menu via button within window 1 -> open context menu within main menu -> execption); 'native' branch shows that it is working without MahApps.Metro and finally my workaround in branch 'working', where I decentralized MahApps declarations into MainWindow and WindowBase. During my investigations I saw that the DropShadowEffect is not freezed, like the SolidColorBrushes within menu and contextmenu styles. Best regards, |
Hi @gordon771 thank you for the sample. You are right, it seems to be related to MahApps. if I replace it with a normal Window it works. happy coding |
and here is the link: https://github.com/gordon771/MahAppsTest |
@gordon771 I created a PR at your test project gordon771/MahAppsTest#2 If you want to use WPF windows in different threads then it's necessary to add the MahApps resources to each window. |
Hi @punker76 , okay, that was my workaround so far. Thank you for your answer and your effort! Best regards, |
Introduce shadow key - MahApps.DropShadowEffect.Menu - MahApps.DropShadowEffect.Menu.VisualStudio
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
The text was updated successfully, but these errors were encountered: