我可以将下载图像扩展到多个线程吗? [英] Can I expand downloading images to several threads?
问题描述
我遇到了ListBox
的问题,该问题不适用于我的收藏集(嵌套列表框,非静态大小等).我尝试了
I had a problem with ListBox
, which doesn't work fine with my collection (nested listboxes, non static size, etc). I tried DeferredLoadListBox, but it requires static height(not my variant).
因此,我尝试将ItemsControl
与ScrollViewer
一起使用,效果确实很好!我滚动流畅,没有滞后,正是我所需要的.但!据我了解,ListBox
仅在需要此内容时才动态下载内容,而ItemsControl
一次加载所有内容.
So, I tried ItemsControl
with ScrollViewer
, and it works realy good! I have smooth scrolling, no lags, its exactly what i needed. But! As I understand, ListBox
download content dynamically, only when it need this content, and ItemsControl
loads all the content in one time.
这是一个问题,因为我在ItemsControl
中加载了40-50个项目的集合,每个项目具有1-4张图像,大约需要5-6秒(比ItemsControl
效果更好).据我了解-在这5-6秒钟内,它会下载所有图像. 问题-有什么方法可以将此操作扩展到多个线程,并使用此提示减少ItemsControl's
冻结?
And its a problem, because I load in ItemsControl
a collection of 40-50 items, and each item has 1-4 images, and it takes about 5-6 seconds(than ItemsControl
works great). As I understand - in this 5-6 seconds it downloads all the images. Question - is there any way to expand this operation to several threads, and using this hint reduce the ItemsControl's
freezing?
推荐答案
Just use LowProfileImageLoader with the standard ListBox
这篇关于我可以将下载图像扩展到多个线程吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!