Exemplo n.º 1
0
 public void ChangeValidateCanExecute()
 {
     try
     {
         bool validatesDateRange = _validateDateRange() == null;
         if (validatesDateRange)
         {
             _validateCommand.ChangeCanExecute();
         }
     }
     catch (Exception ex)
     {
         Logger.Log(ex);
     }
 }
Exemplo n.º 2
0
        private void _client_selected(object sender, EventArgs e)
        {
            bool nothingSelected   = _searchClientVMsView.CurrentPosition == -1;
            bool somethingSelected = !nothingSelected;
            bool canExecute        = _selectClientCommand.CanExecute(null);
            bool cannotExecute     = !canExecute;

            if (
                (nothingSelected && canExecute) ||
                (somethingSelected && cannotExecute)
                )
            {
                _selectClientCommand.ChangeCanExecute();
            }
        }
Exemplo n.º 3
0
        private void _clientBookingsView_currentChanged(object sender, EventArgs e)
        {
            bool nothingSelected   = _clientBookingsView.CurrentPosition == -1;
            bool somethingSelected = !nothingSelected;
            bool canExecute        = _selectBookingCommand.CanExecute(null);

            if (
                (somethingSelected && !canExecute) ||
                (nothingSelected && canExecute)
                )
            {
                _selectBookingCommand.ChangeCanExecute();
                _cancelBookingCommand.ChangeCanExecute();
            }
        }
Exemplo n.º 4
0
        private void _unlockSaveAndSumUpIfNeeded()
        {
            bool canSave  = _saveClientCommand.CanExecute(null);
            bool canSumUp = _sumUpCommand.CanExecute(null);
            bool isValid  = ((IDataErrorInfo)_clientEntity).Error == null;

            if ((canSave && !isValid) ||
                (!canSave && isValid)
                )
            {
                _saveClientCommand.ChangeCanExecute();
            }

            if ((canSumUp && !isValid) ||
                (!canSumUp && isValid)
                )
            {
                _sumUpCommand.ChangeCanExecute();
            }
        }