Class RelayCommand
Relay command with logging capabilities.
Inheritance
Implements
Inherited Members
Namespace: Vortex.Presentation.Wpf
Assembly: Vortex.Presentation.Wpf.dll
Syntax
public class RelayCommand : ICommand
Constructors
RelayCommand(Action<Object>)
Creates new instance of RelayCommand.
Declaration
public RelayCommand(Action<object> executeMethod)
Parameters
Type | Name | Description |
---|---|---|
System.Action<System.Object> | executeMethod | Method to be executed with this command. |
RelayCommand(Action<Object>, Func<Object, Boolean>)
Creates new instance of RelayCommand.
Declaration
public RelayCommand(Action<object> executeMethod, Func<object, bool> canExecuteMethod = null)
Parameters
Type | Name | Description |
---|---|---|
System.Action<System.Object> | executeMethod | Method to be executed with this command. |
System.Func<System.Object, System.Boolean> | canExecuteMethod | Can execute method determined whether this command can be executed. |
RelayCommand(Action<Object>, Func<Object, Boolean>, Object, String)
Creates new instance of RelayCommand.
Declaration
public RelayCommand(Action<object> executeMethod, Func<object, bool> canExecuteMethod = null, object callerObject = null, string commandName = "")
Parameters
Type | Name | Description |
---|---|---|
System.Action<System.Object> | executeMethod | Method to be executed with this command. |
System.Func<System.Object, System.Boolean> | canExecuteMethod | Can execute method determined whether this command can be executed. |
System.Object | callerObject | Object that invoked this command. |
System.String | commandName | Optional command description of the command to enrich the logged data. |
RelayCommand(Action<Object>, Func<Object, Boolean>, IVortexObject, String)
Creates new instance of RelayCommand.
Declaration
public RelayCommand(Action<object> executeMethod, Func<object, bool> canExecuteMethod = null, IVortexObject callerObject = null, string commandName = "")
Parameters
Type | Name | Description |
---|---|---|
System.Action<System.Object> | executeMethod | Method to be executed with this command. |
System.Func<System.Object, System.Boolean> | canExecuteMethod | Can execute method determined whether this command can be executed. |
IVortexObject | callerObject | Object that invoked this command. |
System.String | commandName | Optional command description of the command to enrich the logged data. |
Fields
_callerObject
Declaration
object _callerObject
Field Value
Type | Description |
---|---|
System.Object |
_commandName
Declaration
string _commandName
Field Value
Type | Description |
---|---|
System.String |
_vortexCallerObject
Declaration
IVortexObject _vortexCallerObject
Field Value
Type | Description |
---|---|
IVortexObject |
canExecute
Declaration
Func<object, bool> canExecute
Field Value
Type | Description |
---|---|
System.Func<System.Object, System.Boolean> |
execute
Declaration
Action<object> execute
Field Value
Type | Description |
---|---|
System.Action<System.Object> |
Methods
CanExecute(Object)
Declaration
public bool CanExecute(object parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parameter |
Returns
Type | Description |
---|---|
System.Boolean |
Execute(Object)
Declaration
public void Execute(object parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parameter |
Events
CanExecuteChanged
Adds or removes CanExecuteChanged handler.
Declaration
public event EventHandler CanExecuteChanged
Event Type
Type | Description |
---|---|
System.EventHandler |