private void Branches_Row_DoubleClick(object sender, RoutedEventArgs e) { DataGridRow r = sender as DataGridRow; Branch d = r.Item as Branch; UpdateBranchPage p = new UpdateBranchPage(bl.getBranch(d.BranchID)); p.branch = d; NavigationService.Navigate(p); }
private void BranchEditButton_Click(object sender, RoutedEventArgs e) { try { Branch obj = ((FrameworkElement)sender).DataContext as Branch; UpdateBranchPage p = new UpdateBranchPage(bl.getBranch(obj.BranchID)); this.NavigationService.Navigate(p); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }