Esempio n. 1
0
 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);
         }
     }
 }
Esempio n. 2
0
 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);
         }
     }
 }