private void ButtonAdd_Click(object sender, RoutedEventArgs e) { CWheel newitem = new CWheel("", 1590); TireEditor geditor = new TireEditor(this.Title, newitem); if (geditor.ShowDialog() != true) { return; } data.wheelList.Add(newitem); ButtonSave.IsEnabled = true; LoadData(); }
private void ButtonModify_Click(object sender, RoutedEventArgs e) { if (listBox1.SelectedIndex == -1) { return; } TireEditor editor = new TireEditor(this.Title, (CWheel)listBox1.SelectedItem); if (editor.ShowDialog() == true) { ButtonSave.IsEnabled = true; } listBox1.Items.Refresh(); }