Class DelegateCommand
An System.Windows.Input.ICommand whose delegates do not take any parameters for Execute() and CanExecute().
Namespace: Sartorius.SAF.Presentation.Commands
Assembly: Sartorius.SAF.Presentation.dll
Syntax
public class DelegateCommand : DelegateCommandBase, ICommand, IActiveAware
Constructors
View SourceDelegateCommand(Action)
Creates a new instance of DelegateCommand with the System.Action to invoke on execution.
Declaration
public DelegateCommand(Action executeMethod)
Parameters
Type | Name | Description |
---|---|---|
System.Action | executeMethod | The System.Action to invoke when System.Windows.Input.ICommand.Execute(System.Object) is called. |
DelegateCommand(Action, Func<Boolean>)
Creates a new instance of DelegateCommand with the System.Action to invoke on execution and a langword_csharp_Func to query for determining if the command can execute.
Declaration
public DelegateCommand(Action executeMethod, Func<bool> canExecuteMethod)
Parameters
Type | Name | Description |
---|---|---|
System.Action | executeMethod | The System.Action to invoke when System.Windows.Input.ICommand.Execute(System.Object) is called. |
System.Func<System.Boolean> | canExecuteMethod | The System.Func<TResult> to invoke when System.Windows.Input.ICommand.CanExecute(System.Object) is called |
Methods
View SourceCanExecute()
Determines if the command can be executed.
Declaration
public bool CanExecute()
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the command can execute,otherwise returns false. |
Execute()
Executes the command.
Declaration
public void Execute()