/// <summary> /// Ouvre la facture séléctionnée en lecture seule à l'aide d'une nouvelle fenêtre /// </summary> public Personne Look(Personne personneToLook) { if (this._DataGridMain.SelectedItem != null || personneToLook != null) { if (this._DataGridMain.SelectedItems.Count == 1 || personneToLook != null) { //Affichage du message "affichage en cours" ((App)App.Current)._theMainWindow.progressBarMainWindow.IsIndeterminate = true; ((App)App.Current)._theMainWindow.changementTexteStatusBar("Affichage d'un contact en cours ..."); //Création de la fenêtre ContactWindow contactWindow = new ContactWindow(); //Initialisation du Datacontext en Commande_Fournisseur et association à la Commande_Fournisseur sélectionnée contactWindow.DataContext = new Personne(); if (personneToLook != null) { contactWindow.DataContext = personneToLook; } else { contactWindow.DataContext = (Personne)this._DataGridMain.SelectedItem; } //Je positionne la lecture seule sur la fenêtre contactWindow.lectureSeule(); contactWindow.soloLecture = true; //J'affiche la fenêtre bool? dialogResult = contactWindow.ShowDialog(); //Affichage du message "affichage en cours" ((App)App.Current)._theMainWindow.progressBarMainWindow.IsIndeterminate = false; ((App)App.Current)._theMainWindow.changementTexteStatusBar("Affichage d'un contact terminé : " + this.Contacts.Count() + " / " + this.max); //Renvoi null return null; } else { MessageBox.Show("Vous ne devez sélectionner qu'un seul contact.", "Attention", MessageBoxButton.OK, MessageBoxImage.Exclamation); return null; } } else { MessageBox.Show("Vous devez sélectionner un contact.", "Attention", MessageBoxButton.OK, MessageBoxImage.Exclamation); return null; } }