示例#1
0
 private void EditMenuItemClick(object sender, RoutedEventArgs e)
 {
     if (MainTable.SelectedItems != null && MainTable.SelectedItems.Count == 1)
     {
         var item = MainTable.SelectedItem as UnitRepair;
         if (item != null)
         {
             var dialog = new RepairEdit(item.Id);
             dialog.Closed += (s, j) => Refresh();
             dialog.Show();
         }
     }
 }
示例#2
0
 private void HardGridMouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     var element = e.MouseDevice.DirectlyOver as FrameworkElement;
     if (element != null && element.Parent is DataGridCell)
     {
         var tempGrid = sender as DataGrid;
         if (tempGrid != null)
         {
             if (tempGrid.SelectedItems != null && tempGrid.SelectedItems.Count == 1)
             {
                 var item = tempGrid.SelectedItem as UnitRepair;
                 if (item != null)
                 {
                     var dialog = new RepairEdit(item.Id);
                     dialog.Closed += (s, j) => Refresh();
                     dialog.Show();
                 }
             }
         }
     }
 }