Class RelayCommand<T>
Relay command with logging capabilities.
Inheritance
System.Object
RelayCommand<T>
Implements
System.Windows.Input.ICommand
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Vortex.Presentation.Wpf
Assembly: Vortex.Presentation.Wpf.dll
Syntax
public class RelayCommand<T> : ICommand
Type Parameters
Name | Description |
---|---|
T |
Constructors
RelayCommand(Action<T>, Func<T, Boolean>, Object, String)
Creates new instance of RelayCommand.
Declaration
public RelayCommand(Action<T> executeMethod, Func<T, bool> canExecuteMethod = null, object callerObject = null, string commandName = "")
Parameters
Type | Name | Description |
---|---|---|
System.Action<T> | executeMethod | Method to be executed with this command. |
System.Func<T, 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<T>, Func<T, Boolean>, IVortexObject, String)
Creates new instance of RelayCommand.
Declaration
public RelayCommand(Action<T> executeMethod, Func<T, bool> canExecuteMethod = null, IVortexObject callerObject = null, string commandName = "")
Parameters
Type | Name | Description |
---|---|---|
System.Action<T> | executeMethod | Method to be executed with this command. |
System.Func<T, 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 |
_TargetCanExecuteMethod
Declaration
Func<T, bool> _TargetCanExecuteMethod
Field Value
Type | Description |
---|---|
System.Func<T, System.Boolean> |
_TargetExecuteMethod
Declaration
Action<T> _TargetExecuteMethod
Field Value
Type | Description |
---|---|
System.Action<T> |
_vortexCallerObject
Declaration
IVortexObject _vortexCallerObject
Field Value
Type | Description |
---|---|
IVortexObject |
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 |
RaiseCanExecuteChanged()
Forces raising of CanExecuteChanged can execute event.
Declaration
public void RaiseCanExecuteChanged()
Events
CanExecuteChanged
Can execute handler.
Declaration
public event EventHandler CanExecuteChanged
Event Type
Type | Description |
---|---|
System.EventHandler |
Implements
System.Windows.Input.ICommand