private void EditCar_Click(object sender, RoutedEventArgs e) { carToSend = (Car)lstCars.SelectedItem; AddEditDialog aeDialog1 = new AddEditDialog(carToSend); aeDialog1.Owner = this; aeDialog1.AssignResult += AddEditDlg_AssignResult; //show dialog bool?result = aeDialog1.ShowDialog(); }
private void AddButtonClicked(object sender, RoutedEventArgs e) { carToSend = null; AddEditDialog aeDialog = new AddEditDialog(carToSend); aeDialog.Owner = this; aeDialog.AssignResult += AddEditDlg_AssignResult; //show dialog bool?result = aeDialog.ShowDialog(); }