MaterialDesignInXamlToolkit icon indicating copy to clipboard operation
MaterialDesignInXamlToolkit copied to clipboard

The program freezes

Open YourName2024 opened this issue 1 year ago • 8 comments

Bug explanation

Hello. I decided to write a program using your styles. I connected them to resources and started using them. As a result, I noticed when the computer is blocked and we log in. The program freezes completely and the buttons and elements do not work. Interestingly, the double-click action is hung on the DataGrid. Which brings up the edit button. And this action works. But it opens a completely empty form.

Version

1.2.7 and 3.2.0

YourName2024 avatar Feb 06 '24 06:02 YourName2024

I solved this problem, but I don't know how much is correct. I didn't use hide() on the first form, but Close()

YourName2024 avatar Feb 06 '24 06:02 YourName2024

@YourName2024 are you able to provide an example that reproduces the problem. There is not enough information here to provide a fix or solution.

Keboo avatar Feb 08 '24 04:02 Keboo

@YourName2024 are you able to provide an example that reproduces the problem. There is not enough information here to provide a fix or solution.

I'm having the same issue. After opening a new window and hiding the main window, if the user locks/unlocks the screen, then the application locks up.

My current work around is to disable hardware acceleration (RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;)

-WPF, .net 8, windows application

Code calling new new window: CheckListForm cLWin = new() { Owner = Application.Current.MainWindow, WindowStartupLocation = WindowStartupLocation.CenterOwner, MainWindowReference = this }; cLWin.Show(); Hide(); Lockup

jf1187gh avatar Feb 12 '24 13:02 jf1187gh

This issue is marked stale because it has been open 30 days with no activity. Remove stale label or update the issue, otherwise it will be closed in 14 days.

github-actions[bot] avatar Mar 14 '24 01:03 github-actions[bot]

@jf1187gh are you able to provide a sample repo that reproduces the issue?

Keboo avatar Mar 14 '24 03:03 Keboo

@jf1187gh are you able to provide a sample repo that reproduces the issue?

I uploaded a stripped down sample. Issue happens when the second window is maximized, and then the computer is locked. Upon unlock, the window freezes.

https://github.com/jf1187gh/MD_XAML

jf1187gh avatar Mar 14 '24 12:03 jf1187gh

This issue is marked stale because it has been open 30 days with no activity. Remove stale label or update the issue, otherwise it will be closed in 14 days.

github-actions[bot] avatar Apr 14 '24 02:04 github-actions[bot]

Were you able to reproduce the issue with my sample code?

jf1187gh avatar Apr 18 '24 12:04 jf1187gh

This issue is marked stale because it has been open 30 days with no activity. Remove stale label or update the issue, otherwise it will be closed in 14 days.

github-actions[bot] avatar May 19 '24 01:05 github-actions[bot]

This issue is marked stale because it has been open 30 days with no activity. Remove stale label or update the issue, otherwise it will be closed in 14 days.

github-actions[bot] avatar Jun 19 '24 01:06 github-actions[bot]

This will be fixed with #3616 .

@jf1187gh the solution to your problem is adding following inside your Window tag:

<Window
    xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"
    md:ShadowAssist.CacheMode="{x:Null}" 

The culprit is the Menu. It uses a by default enabled CacheMode through the Material Design style and it seems it has trouble when coming back from the Windows lock screen. Removing the CacheMode effectively removes any caching and the problem disappears. Why the freezing happens when using this CacheMode, I don't know.

MichelMichels avatar Jun 26 '24 20:06 MichelMichels