Class DelegateCommand<TParameter>
Base class for generic delegate commands
Implements
System.Windows.Input.ICommand
Inherited Members
Namespace: MAT.Atlas.Client.Presentation.Commands
Assembly: MAT.Atlas.Client.Presentation.dll
Syntax
public class DelegateCommand<TParameter> : DelegateCommand, ICommand
Type Parameters
Name | Description |
---|---|
TParameter | The type of the parameter. |
Constructors
DelegateCommand(Action<TParameter>, Predicate<TParameter>)
Initializes a new instance of the DelegateCommand<TParameter> class.
Declaration
public DelegateCommand(Action<TParameter> executeDelegate, Predicate<TParameter> canExecuteDelegate = null)
Parameters
Type | Name | Description |
---|---|---|
System.Action<TParameter> | executeDelegate | The execute delegate. |
System.Predicate<TParameter> | canExecuteDelegate | The can execute delegate. |
Methods
CanExecute(Object)
Defines the method that determines whether the command can execute in its current state.
Declaration
public override bool CanExecute(object parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parameter | Data used by the command. If the command does not require data to be passed, this object can be set to null. |
Returns
Type | Description |
---|---|
System.Boolean | true if this command can be executed; otherwise, false. |
Overrides
Execute(Object)
Defines the method to be called when the command is invoked.
Declaration
public override void Execute(object parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parameter | Data used by the command. If the command does not require data to be passed, this object can be set to null. |
Overrides
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The CanExecute(Object) method returns false. |
Implements
System.Windows.Input.ICommand