private void Add(object sender, MouseButtonEventArgs e) { // ajoute une personne Person p = new Person(); PersonWindow dialog = new PersonWindow(p); if (dialog.ShowDialog() == true) { a.Add(p); PrintList(); } }
private void Edit(object sender, MouseButtonEventArgs e) { // modifie la personne if (contacts.SelectedItem is PersonHMI p) { Person temp = p.P.Clone() as Person; PersonWindow dialog = new PersonWindow(temp); if (dialog.ShowDialog() == true) { p.Copy(temp); PrintList(); } } }