Closed Divyesh-13 closed 2 years ago
Hello. Please can you provide a bit more info about issue?
I have a project with more then one Material Design WPF forms that will interact with each other. When I login to my first form it hides and the second form shows after I successfully logged in.
However when I perform a screen lock (Win+L) and resume my workstation, the UI freezes .
I found out that the trigger of this issue is the hiding of my first form because I tried commenting the Hide() function in my first form and it went well. I tried to pass the first instance of my form to the second to solve it but it didn't went well.
I also recreated the steps and applied it to your sample project and the result is very similar when I do screen lock.
Why is it that the 2nd form freezes when I call Hide() in my first form? Any solutions for this bug?
This is known issue related to WPF, not to material design xaml library. To resolve issue you need to explicitly close first window OR remove shadow cache (with ShadowAssist)
that thing already i tried but not working and implement at level of windows also but still ui freezes
Slider Grid.Column="1" Minimum="5" Maximum="20" Width="500" materialDesign:ShadowAssist.CacheMode="{x:Null}" HorizontalAlignment="Left" Value="{Binding SettingDetail.BeforeMaxLimit}"
You need to ensure that no any BitmapCache is used in all controls. Probably some control contains BitmapCache in style.
Ok, I found that slider contains BitmapCache directly in Style. To resolve it you need to copy style from https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/blob/master/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Slider.xaml and remove ALL CacheMode setters. In that case slider only uses AdornerDecorator. So, you need to remove only
`
</AdornerDecorator.CacheMode>`
Apply this style to all other sliders after changes
Hello , I am new to wpf can u help me I am using "MaterialDesignDiscreteSlider"
after remove also same thing ui freezes
Probably some other controls uses bitmap cache too. To detect it you need to search over all controls in XAML of you window. You need to: 1) Find control with bitmapcache 2) Remove bitmapcache in style 3) Set that style to control
I can't help without more info. Please if you can send a link to project or send code here. Otherwise, you need just to find all controls with bitmapcache and remove them, see what's happens. Only MaterialDesignToolBar and Sliders use BitmapCache that cann't be controlled via ShadowAssist.CacheMode
this is a demo project https://github.com/Divyesh-13/test
@Divyesh-13 please make this repository as public or check a link.
Sorry now check click on login button and lock screen then try to change value for slider
This is a known issue https://github.com/Erapchu/GhostWindows You need to avoid hide WPF windows at all. You may close first window and open second one. The root of this behavior is BitmapCache
ok thankyou
Hello,
In the application when screen lock after unlock application is freezes if slider is remove then application work normally