Class ExceptionHandlingRelayCommand
Represents a relay command, which swallows all exceptions and logs them using the ShowException(Exception, ILogger) method.
public class ExceptionHandlingRelayCommand : RelayCommand, ICommand
- Inheritance
-
ExceptionHandlingRelayCommand
- Implements
- Inherited Members
Constructors
ExceptionHandlingRelayCommand(Action<object>)
Initializes a new instance of the ExceptionHandlingRelayCommand class.
public ExceptionHandlingRelayCommand(Action<object> execute)
Parameters
ExceptionHandlingRelayCommand(Action<object>, Predicate<object>)
Initializes a new instance of the ExceptionHandlingRelayCommand class.
public ExceptionHandlingRelayCommand(Action<object> execute, Predicate<object> canExecute)
Parameters
execute
Action<object>The action to execute.
canExecute
Predicate<object>The method that determines whether the command can be executed.
Methods
CanExecute(object)
Tries to execute the method that determines whether the command can be executed.
public override bool CanExecute(object parameter)
Parameters
parameter
objectData used by the command.
Returns
- bool
true if this command can be executed; otherwise, false.
Execute(object)
Tries to execute the set action.
public override void Execute(object parameter)
Parameters
parameter
objectData used by the command.