/// <summary> /// Ouvre le Motif séléctionné à l'aide d'une nouvelle fenêtre /// </summary> public Evenement_Remboursement Look() { if (this._DataGridMain.SelectedItem != null) { if (this._DataGridMain.SelectedItems.Count == 1) { //Affichage du message "affichage en cours" ((App)App.Current)._theMainWindow.parametreMain.progressBarMainWindow.IsIndeterminate = true; ((App)App.Current)._theMainWindow.parametreMain.textBlockMainWindow.Text = "Affichage d'un Event remboursement en cours ..."; //Création de la fenêtre EvenementRemboursementWindow EvenementRemboursementWindow = new EvenementRemboursementWindow(); //Initialisation du Datacontext EvenementRemboursementWindow.DataContext = new Evenement_Remboursement(); EvenementRemboursementWindow.DataContext = (Evenement_Remboursement)this._DataGridMain.SelectedItem; //Je positionne la lecture seule sur la fenêtre EvenementRemboursementWindow.lectureSeule(); //J'affiche la fenêtre bool? dialogResult = EvenementRemboursementWindow.ShowDialog(); //Affichage du message "affichage en cours" ((App)App.Current)._theMainWindow.parametreMain.progressBarMainWindow.IsIndeterminate = false; ((App)App.Current)._theMainWindow.parametreMain.textBlockMainWindow.Text = "Affichage d'un Event remboursement terminé : " + this.listEvent.Count() + " / " + this.max; //Renvoi null return null; } else { MessageBox.Show("Vous ne devez sélectionner qu'un seul Event remboursement.", "Attention", MessageBoxButton.OK, MessageBoxImage.Exclamation); return null; } } else { MessageBox.Show("Vous devez sélectionner un Event remboursement.", "Attention", MessageBoxButton.OK, MessageBoxImage.Exclamation); return null; } }