Esempio n. 1
0
        private void dg_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            vm = (PTIViewModel)DataContext;
            DataGrid dg   = (DataGrid)sender;
            var      item = (PTI)dg.SelectedItem;

            if (item != null)
            {
                vm.ShowDetails(item);
            }
        }
Esempio n. 2
0
 private void Dg_PreviewKeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter || e.Key == Key.Return)
     {
         vm = (PTIViewModel)DataContext;
         DataGrid dg   = (DataGrid)sender;
         var      item = (PTI)dg.SelectedItem;
         if (item != null)
         {
             vm.ShowDetails(item);
         }
     }
 }