wpf - How does VirtualizingStackPanel decide when to unload (dispose?) of virtualized controls? -
i'm working itemscontrol using virtualizingstackpanel in controltemplate. i've got virtualization working, extent. i've put debugging statements in loaded , unloaded event handlers controls in datatemplate items, don't unloaded after controls go out of view. there way force behaviour ?
you might have luck setting virtualizationmode recycled. there comments in source code virtualizingstackpanel.cs indicate recycled mode cleans renderers (instead of doing in background):
// // delayed cleanup used when virtualizationmode standard (not recycling) , panel scrolling , item-based // chooses defer virtualizing items until there enough available. cleans them using background priority dispatcher // work item //
note, can find full source virtualizingstackpanel here:
Comments
Post a Comment