Exemple #1
0
 public void Execute(object parameter)
 {
     if (first.CanExecute(parameter))
     {
         first.Execute(parameter);
     }
     else
     {
         second.Execute(parameter);
     }
 }
Exemple #2
0
        internal static bool Execute(object sender, System.Windows.Input.ICommand command, object commandParameter)
        {
            if (command != null)
            {
                RoutedCommand routedCommand = command as RoutedCommand;
                IInputElement inputElement  = sender as IInputElement;
                if (routedCommand != null && routedCommand.CanExecute(commandParameter, inputElement))
                {
                    routedCommand.Execute(commandParameter, inputElement);
                    return(true);
                }
                else if (command.CanExecute(commandParameter))
                {
                    command.Execute(commandParameter);
                    return(true);
                }
            }

            return(false);
        }
Exemple #3
0
        private void RaiseCommandExecute()
        {
            System.Windows.Input.ICommand command = this.Command;
            if (command != null)
            {
                object parameter = this.ReadLocalValue(RadRating.CommandParameterProperty);
                if (parameter == DependencyProperty.UnsetValue)
                {
                    parameter = this.Value;
                }
                else
                {
                    parameter = this.GetValue(RadRating.CommandParameterProperty);
                }

                if (command.CanExecute(parameter))
                {
                    command.Execute(parameter);
                }
            }
        }
Exemple #4
0
 public bool CanExecute(object parameter)
 {
     return(first.CanExecute(parameter) || second.CanExecute(parameter));
 }
Exemple #5
0
 public bool CanExecute(object parameter)
 {
     return(baseCommand.CanExecute(parameter));
 }