private void DoWork(object sender, DoWorkEventArgs e) { foreach (string file in Directory.EnumerateFiles(_dirpath, "*.*", SearchOption.AllDirectories).Where(s => s.EndsWith(".png") || s.EndsWith(".jpg"))) { AsScanned asListItem = AppCore.CheckImage(file); _scans.Add(asListItem); } e.Result = _scans; }
private void BtnImgBrowser_Click(object sender, RoutedEventArgs e) { var dlg = new Microsoft.Win32.OpenFileDialog { Title = "Select an Image", Filter = "Images |*.jpg; *.png", CheckFileExists = true }; if (dlg.ShowDialog() == true) { AsScanned scan = AppCore.CheckImage(dlg.FileName); AsListItem asListItem = new AsListItem { Title = scan.Title, Image = scan.Image, Score = scan.Score }; ImageList.Children.Add(asListItem); } }