private void dataGridCustomers_MouseDoubleClick(object sender, MouseButtonEventArgs e) { Customer selected = dataGridCustomers.SelectedItem as Customer; if (selected.id <1) { return; } CustomerEdit editWin = new CustomerEdit(selected); editWin.Owner = this; editWin.ShowDialog(); }
private void buttonEdit_Click(object sender, RoutedEventArgs e) { Customer selected = dataGridCustomers.SelectedItem as Customer; if (dataGridCustomers.SelectedItem == null) { return; } CustomerEdit editWin = new CustomerEdit(selected); editWin.Owner = this; editWin.ShowDialog(); }