void selectBtn_Click(object sender, RoutedEventArgs e) { if (motorcycle_list.SelectedItem != null) { var scan_data = new motorcyclelist(); scan_data = motorcycle_list.SelectedItem as motorcyclelist; if (MessageBox.Show("Do you want to select?", "Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Information) == MessageBoxResult.Yes) { if (scan_data.IsSelected == 0) { list.Add(scan_data); selected_motor.ItemsSource = null; selected_motor.ItemsSource = list; scan_data.IsSelected = 1; MessageBox.Show("Data is Added to the Selected Motorycles Tab Successfully!"); } } else { return; } } else { MessageBox.Show("Select in the Motorcyclelist First!"); return; } }
void addBtn_Click(object sender, RoutedEventArgs e) { var add_mo = new add_window(); var new_motorcycles = new motorcyclelist(); add_mo.Set(new_motorcycles); add_mo.ShowDialog(); if (add_mo.Result(ref new_motorcycles)) { motorcyclelist_.Add(new_motorcycles); motorcycle_list.ItemsSource = null; motorcycle_list.ItemsSource = motorcyclelist_; MessageBox.Show("Data Is Added successfully!"); } }
public bool Result(ref motorcyclelist value) { value = motor; return(is_input_); }
public void Set(motorcyclelist value) { motor = value; DataContext = motor; }