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);
         }
     }
 }
 internal void LoadSMU()
 {
     if (User.CanAccess(MethodBase.GetCurrentMethod()))
     {
         var form      = new Views.SMUView();
         var viewmodel = new Views.SMUViewModel()
         {
             WindowClose = form.Close
         };
         form.DataContext = viewmodel;
         Helpers.ShowChild(WindowParent, form);
     }
     else
     {
         Helpers.ShowErrorMessage(NotHaveAccess);
     }
 }