Beispiel #1
0
        private void dg_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            vm = (SMUViewModel)this.DataContext;
            DataGrid dg   = (DataGrid)sender;
            var      item = (SMU)dg.SelectedItem;

            if (item != null)
            {
                vm.ShowDetails(item);
            }
        }
Beispiel #2
0
 private void Dg_PreviewKeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter || e.Key == Key.Return)
     {
         vm = (SMUViewModel)this.DataContext;
         DataGrid dg   = (DataGrid)sender;
         var      item = (SMU)dg.SelectedItem;
         if (item != null)
         {
             vm.ShowDetails(item);
         }
     }
 }