private async void OpenImageFolder() { var source = _uiService.OpenFolderDialog(); if (string.IsNullOrEmpty(source)) { return; } var prevImageList = new List <PrevImage>(); await Task.Factory.StartNew(() => { var filters = new[] { "jpg", "jpeg", "png", "gif", "tiff", "bmp" }; var files = FileUtils.GetFilesFrom(source, filters, true); foreach (var image in files.Select(x => new Models.PrevImage(x))) { prevImageList.Add(image); } }); if (!prevImageList.Any()) { _uiService.ShowError(Constants.MissingImage); return; } else { ImageList.Clear(); foreach (var image in prevImageList) { ImageList.Add(image); } RefreshCommands(); } }