MaterialDesignInXamlToolkit
MaterialDesignInXamlToolkit copied to clipboard
Poor performance following ShadowAssist.CacheMode change #3616
Bug explanation
It seems that specifically following commit #3616 to change the default ShadowAssist CacheMode behaviour, I find the performance of our WPF app to be a lot slower and laggy than it was before, particularly when it comes to animations such as those in the DialogHost flyouts. It's particularly bad after resizing the window or in full screen.
I'm trying to figure out the best way to replicate the old behaviour. I've tried to set a CacheMode with EnableClearType and SnapsToDevicePixels but it seems like I have to set this all the way down and just setting it on the window or main containing control doesn't work.
Would appreciate any guidance on this. Has anyone else had a similar problem or know the best way to handle the CacheMode property globally? Is that even the right approach or should it only be set for troublesome controls?
Version
5.2.1
Further to this. And seemingly specifically to do with the Cards, their performance is far worse after this change. We have added the following to our style that targets the MaterialWindow to allow the AttachedProperties Inherits to trickle down
<Setter Property="md:ShadowAssist.CacheMode">
<Setter.Value>
<BitmapCache EnableClearType="True"
SnapsToDevicePixels="True" />
</Setter.Value>
</Setter>
This seems to have fixed numerous issues, except for the Cards, which continue to perform poorly after this commit (for some reason). Adding this to the cards then returns their performance to pre-commit levels:
<md:Card.CacheMode>
<BitmapCache
EnableClearType="True"
SnapsToDevicePixels="True" />
</md:Card.CacheMode>