Beispiel #1
0
 private void TreeLaserMeterDevice_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (sender is TreeViewItem viewItem)
     {
         MonchaCadViewer.DeviceManager.LaserMeterWindows laserMeterWindows = new MonchaCadViewer.DeviceManager.LaserMeterWindows(viewItem.DataContext as VLTLaserMeters);
         laserMeterWindows.ShowDialog();
     }
 }
Beispiel #2
0
 private void LaserMeters_ContextMenuClosing(object sender, ContextMenuEventArgs e)
 {
     if (sender is TreeViewItem viewItem)
     {
         if (viewItem.ContextMenu.DataContext is MenuItem cmindex && sender is TreeViewItem treeView)
         {
             switch (cmindex.Tag)
             {
             case "common_ADD":
                 MonchaCadViewer.DeviceManager.LaserMeterWindows laserMeterWindows = new MonchaCadViewer.DeviceManager.LaserMeterWindows(new VLTLaserMeters());
                 laserMeterWindows.ShowDialog();
                 MonchaHub.RefreshDevice();
                 break;
             }
         }
     }
 }