private void AddCarButton_Click(object sender, RoutedEventArgs e) { VehicleWindow vehicleWindow = new VehicleWindow { Owner = this }; vehicleWindow.Show(); }
private void EditCarButton_Click(object sender, RoutedEventArgs e) { Vehicle v = ObjectListView.SelectedItem as Vehicle; if (v == null) { return; } VehicleWindow vehicleWindow = new VehicleWindow(v) { Owner = this }; vehicleWindow.VehicleUpdated += VehicleWindow_VehicleUpdated; vehicleWindow.Show(); }
private void ObjectListView_MouseDoubleClick(object sender, MouseButtonEventArgs e) { try { if (sender != null) { ListView listView = sender as ListView; if (listView != null && listView.SelectedItems != null && listView.SelectedItems.Count == 1) { Vehicle v = listView.SelectedItem as Vehicle; VehicleWindow vehicleWindow = new VehicleWindow(v); vehicleWindow.VehicleUpdated += VehicleWindow_VehicleUpdated; vehicleWindow.Owner = this; vehicleWindow.Show(); } } } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } }