private void NewDiverButton_Click(object sender, RoutedEventArgs e) { DiverWindow dw = new DiverWindow(createdEvent.Board); dw.ShowDialog(); Diver d = dw.diver; DiverList.Items.Add(d); divers.Add(d); }
private void EditDiverButton_Click(object sender, RoutedEventArgs e) { int index = DiverList.SelectedIndex; if (index == -1) { return; } Diver toEdit = divers[index]; DiverWindow dw = new DiverWindow(toEdit); dw.ShowDialog(); Diver newDiver = dw.diver; divers[index] = newDiver; DiverList.Items[index] = newDiver; }