private void addButton_Click(object sender, RoutedEventArgs e) { IPerson writeablePerson = _repos.GetWriteablePerson(null); { EditPersonDialog d = new EditPersonDialog(writeablePerson); d.Owner = this; bool?result = d.ShowDialog(); if (result.HasValue && result.Value == true) { _repos.SavePerson(writeablePerson); } } }
private void editButton_Click(object sender, RoutedEventArgs e) { IPerson person = peopleListBox.SelectedItem as IPerson; IPerson writeablePerson = _repos.GetWriteablePerson(person); { EditPersonDialog d = new EditPersonDialog(writeablePerson); d.Owner = this; bool?result = d.ShowDialog(); if (result.HasValue && result.Value == true) { _repos.SavePerson(writeablePerson); } } }