public static void CheckedClicked(DetailFichier detail) { if (detail.IsChecked) { ListeFichier.Add(detail); } else { ListeFichier.Remove(detail); } }
public static void OnChargerListeFichierClicked() { var openFileDialog = new OpenFileDialog { Filter = JSONFILTER, Multiselect = true }; var showDialog = openFileDialog.ShowDialog(); if (showDialog != true) { return; } ListeFichier.Clear(); foreach (var fileName in openFileDialog.FileNames) { var fichier = new DetailFichier { Fichier = fileName }; ListeFichier.Add(fichier); } }
public void OnParcourirClicked() { try { var openFileDialog = new OpenFileDialog { Filter = JSONFILTER, Multiselect = true }; var showDialog = openFileDialog.ShowDialog(); var detail = new DetailFichier { Name = openFileDialog.FileName }; var isChecked = detail.IsChecked; if (showDialog == true && isChecked) { InputPath = openFileDialog.FileName; ListeFichier.Add(detail); } } catch (Exception exception) { MessageBox.Show(exception.Message, "Ouvrir", MessageBoxButton.OK, MessageBoxImage.Error); } }