Ejemplo n.º 1
0
        private void _machine_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName == nameof(Machine.Mode))
            {
                DispatcherServices.Invoke(() =>
                {
                    OpenEagleBoardFileCommand.RaiseCanExecuteChanged();
                    CloseEagleBoardFileCommand.RaiseCanExecuteChanged();
                    OpenHeightMapCommand.RaiseCanExecuteChanged();
                    OpenGCodeCommand.RaiseCanExecuteChanged();
                    ClearGCodeCommand.RaiseCanExecuteChanged();
                    SetMetricUnitsCommand.RaiseCanExecuteChanged();
                    SetImperialUnitsCommand.RaiseCanExecuteChanged();
                    ShowBottomEtchingGCodeCommand.RaiseCanExecuteChanged();
                    ShowTopEtchingGCodeCommand.RaiseCanExecuteChanged();
                    ApplyHeightMapCommand.RaiseCanExecuteChanged();
                });
            }

            if (e.PropertyName == nameof(Machine.GCodeFileManager.HasValidFile))
            {
                ArcToLineCommand.RaiseCanExecuteChanged();
                ApplyHeightMapCommand.RaiseCanExecuteChanged();
            }
        }
Ejemplo n.º 2
0
 private void GCodeFileManager_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     if (e.PropertyName == nameof(Machine.GCodeFileManager.HasValidFile))
     {
         DispatcherServices.Invoke(() =>
         {
             ApplyHeightMapCommand.RaiseCanExecuteChanged();
         });
     }
 }
Ejemplo n.º 3
0
 private void HeightMapManager_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     if (e.PropertyName == nameof(Machine.HeightMapManager.HasHeightMap) ||
         e.PropertyName == nameof(Machine.HeightMapManager.Status) ||
         e.PropertyName == nameof(Machine.HeightMapManager.HeightMapDirty))
     {
         DispatcherServices.Invoke(() =>
         {
             ApplyHeightMapCommand.RaiseCanExecuteChanged();
             SaveHeightMapCommand.RaiseCanExecuteChanged();
             StartProbeHeightMapCommand.RaiseCanExecuteChanged();
             ClearHeightMapCommand.RaiseCanExecuteChanged();
         });
     }
 }
Ejemplo n.º 4
0
 private void PCBManager_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     if (e.PropertyName == nameof(Machine.PCBManager.HasBoard) ||
         e.PropertyName == nameof(Machine.PCBManager.HasProject) ||
         e.PropertyName == nameof(Machine.PCBManager.HasTopEtching) ||
         e.PropertyName == nameof(Machine.PCBManager.HasBottomEtching))
     {
         DispatcherServices.Invoke(() =>
         {
             ApplyHeightMapCommand.RaiseCanExecuteChanged();
             ShowHoldDownGCodeCommand.RaiseCanExecuteChanged();
             ShowDrillGCodeCommand.RaiseCanExecuteChanged();
             ShowCutoutMillingGCodeCommand.RaiseCanExecuteChanged();
             ShowTopEtchingGCodeCommand.RaiseCanExecuteChanged();
             ShowBottomEtchingGCodeCommand.RaiseCanExecuteChanged();
         });
     }
 }