private void EditButton_Click(object sender, RoutedEventArgs e) { Person personToEdit = (Person)MainGrid.SelectedItem; EditPerson editModal = new EditPerson(personToEdit); editModal.ShowDialog(); MainGrid.SelectedIndex = -1; }
private void AddButton_Click(object sender, RoutedEventArgs e) { EditPerson editModal = new EditPerson(new Person() { Id = Guid.NewGuid() }); if (editModal.ShowDialog().Value) { People.Add(editModal.Person); MainGrid.Items.Refresh(); } }