如何释放不在“视野”中的图像控制的存储器。列表视图 [英] How to release memory of image controls which are not in "field of view" of listview
本文介绍了如何释放不在“视野”中的图像控制的存储器。列表视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个带有图像控件的列表视图,绑定了Uri值(磁盘上的图像路径)。
我想要仅转换视野中的那些Uri并处置(或转换回Uri),这些都离开了视野。
提前致谢。
我尝试了什么:
我用IValueConverter进行转换Uri to Image但是ConvertBack没有触发。
< Image Source ={Binding PageSource,Mode = TwoWay,UpdateSourceTrigger = Explicit,Converter = {StaticResource ImageConverter}}HorizontalAlignment =中心VerticalAlignment =Top/>
解决方案
带有数千张图片的WPF ListBox(UI响应) [< a href =https://social.msdn.microsoft.com/Forums/vstudio/en-US/79dba54a-987a-455b-9bfd-d07cb5281192/wpf-listbox-with-thousands-of-images-ui-responsiveness? forum = wpftarget =_ blanktitle =New Window> ^ ]
如何为wpf listview启用虚拟化以提高性能? [ ^ ]
Hi,
I have a listview with Image control, bound with Uri value (image path on disk).
I want to convert only those Uri in "Field of view" and dispose (or convert back to Uri) which goes out of "Field of View".
Thanks in advance.
What I have tried:
I have used IValueConverter to convert Uri to Image but ConvertBack is not firing.
<Image Source="{Binding PageSource,Mode=TwoWay, UpdateSourceTrigger=Explicit, Converter={StaticResource ImageConverter}}" HorizontalAlignment="Center" VerticalAlignment="Top"/>
解决方案
WPF ListBox with Thousands of images (UI responsiveness)[^]
How to enable Virtualization for a wpf listview to improve performance?[^]
这篇关于如何释放不在“视野”中的图像控制的存储器。列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文