private void ItemOnImageLoaded(ImageControl obj)
 {
     ImageLoadingPool.Remove(obj);
     if (ImageWaitForLoadingPool.Any())
     {
         var item = ImageWaitForLoadingPool[0];
         ImageWaitForLoadingPool.Remove(item);
         ImageLoadingPool.Add(item);
         item.ImageLoadEnd += ItemOnImageLoaded;
         var unused = item.LoadImageAndDetailTask();
     }
 }
Пример #2
0
        private void ItemOnImageLoaded(ImageControl obj)
        {
            ImageLoadingPool.Remove(obj);
            if (ImageLoadingPool.Count == 0) // all image loaded
            {
                App.ShowMessage("图片加载完毕", 1);
            }
            else
            {
                var remain = ImageLoadingPool.Count + ImageWaitForLoadingPool.Count;
                App.ShowMessage($"剩余 {remain} 张图片等待加载", 1);
            }

            if (ImageWaitForLoadingPool.Count > 0)
            {
                var item = ImageWaitForLoadingPool[0];
                ImageWaitForLoadingPool.Remove(item);
                ImageLoadingPool.Add(item);
                item.ImageLoadEnd += ItemOnImageLoaded;
                var unused = item.LoadImageAsync();
            }
        }