private void RefreshCommandExecuteStatus()
        {
            ConnectCommand.RaiseCanExecuteChanged();

            ClearAlarmCommand.RaiseCanExecuteChanged();

            SendGCodeFileCommand.RaiseCanExecuteChanged();
            StartProbeCommand.RaiseCanExecuteChanged();
            StartProbeHeightMapCommand.RaiseCanExecuteChanged();
            StopCommand.RaiseCanExecuteChanged();
            PauseCommand.RaiseCanExecuteChanged();

            SoftResetCommand.RaiseCanExecuteChanged();
            HomingCycleCommand.RaiseCanExecuteChanged();
            FeedHoldCommand.RaiseCanExecuteChanged();
            CycleStartCommand.RaiseCanExecuteChanged();

            EmergencyStopCommand.RaiseCanExecuteChanged();

            LaserOnCommand.RaiseCanExecuteChanged();
            LaserOffCommand.RaiseCanExecuteChanged();
            SpindleOnCommand.RaiseCanExecuteChanged();
            SpindleOffCommand.RaiseCanExecuteChanged();

            GotoFavorite1Command.RaiseCanExecuteChanged();
            GotoFavorite2Command.RaiseCanExecuteChanged();
            SetFavorite1Command.RaiseCanExecuteChanged();
            SetFavorite2Command.RaiseCanExecuteChanged();
            GotoWorkspaceHomeCommand.RaiseCanExecuteChanged();
            SetWorkspaceHomeCommand.RaiseCanExecuteChanged();
        }
        private void Machine_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName == nameof(Machine.Connected) ||
                e.PropertyName == nameof(Machine.Mode))
            {
                SoftResetCommand.RaiseCanExecuteChanged();
                ClearAlarmCommand.RaiseCanExecuteChanged();
                FeedHoldCommand.RaiseCanExecuteChanged();
                CycleStartCommand.RaiseCanExecuteChanged();
                JogCommand.RaiseCanExecuteChanged();
                ResetCommand.RaiseCanExecuteChanged();
                HomeCommand.RaiseCanExecuteChanged();
                SetCameraCommand.RaiseCanExecuteChanged();
                SetTool1Command.RaiseCanExecuteChanged();

                SetToMoveHeightCommand.RaiseCanExecuteChanged();
                SetToPickHeightCommand.RaiseCanExecuteChanged();
                SetToPlaceHeightCommand.RaiseCanExecuteChanged();
                MoveToBottomCameraCommand.RaiseCanExecuteChanged();
            }

            if (e.PropertyName == nameof(Machine.ViewType))
            {
                SetCameraCommand.RaiseCanExecuteChanged();
                SetTool1Command.RaiseCanExecuteChanged();
            }

            if (e.PropertyName == nameof(Machine.Settings))
            {
                /* Keep the saved values as temp vars since updating the StepMode will overwrite */
                var originalXYStepSize = Machine.Settings.XYStepSize;
                var originalZStepSize  = Machine.Settings.ZStepSize;

                XYStepMode = Machine.Settings.XYStepMode;
                ZStepMode  = Machine.Settings.ZStepMode;

                XYStepSizeSlider = originalXYStepSize;
                ZStepSizeSlider  = originalZStepSize;
            }
        }