I have a ListView
with different complex ListViewItem
containers consisting of images, shadow effects, blur effects.. etc. Rendering these containers in large amounts heavily reduces performance, especially since i'm using a blur overlay frame on top of the ListView
. Which is why in this case i'm setting CacheMode
to BitmapCache
(improves performance by up to 15x the fps).
<Border.CacheMode>
<BitmapCache />
</Border.CacheMode>
The problem is that i use a WrapPanel
and a ValueConverter
to dynamically resize and fit these containers into the WrapPanel
so that they completely fill the space in either horizontal or tile views. Apparently, that doesn't work well with caching and it produces severe lags/stalls (frame drops to 0).
Currently my 3 options are:
My questions:
Ok. After a lot of reading and experimenting, i figured two things:
First, Caching
should not be used on elements that resize frequently, especially if they're too many (couldn't find out why). So, i basically cached fixed size child elements instead.
And that reminded me of Virtualization
which was exactly what i was missing but didn't know was supported in WPF Lists
.
With some more optimizations, now, i can resize the window buttery smooth.