コード例 #1
0
        public async Task AddImages(IEnumerable <string> filePathes)
        {
            var newVMs = new List <ImageViewModel>();

            foreach (var filePath in filePathes)
            {
                if (Contains(filePath))
                {
                    continue;
                }

                var image = new ImageModel(filePath);
                _collection.Add(image);
                var vm = ViewModelFactory.CreateImageViewModel(image);

                Add(vm);
                newVMs.Add(vm);
            }

            foreach (var imageViewModel in newVMs)
            {
                await imageViewModel.LoadPreviewImage().ConfigureAwait(true);
            }
        }