private void Button_Update_Click(object sender, RoutedEventArgs e) { Company selectedItem = (Company)companyDataGrid.SelectedItem; NewCompanyWindow newCompanyWindow = new NewCompanyWindow(selectedItem, _context, this); newCompanyWindow.ShowDialog(); }
/// <summary> /// Implements the execution of <see cref="CloseCompanyCommand" /> /// </summary> private void CloseCompanyCommand_Execute(object obj) { var close = MessageBox.Show("Are you sure you want to close this company?\nYou can reopen this company later.\nIf yes Please enter new company details after this message.", "confirm", MessageBoxButtons.YesNoCancel); if (DialogResult.Yes == close) { SelectedCompanyBackUp = SelectedCompany; SelectedCompany = new Company(); NewCompanyWindow win = new NewCompanyWindow(this); win.ShowDialog(); } }