Class DelegateCommand
Provides a simple ICommand implementation.
Inheritance
Namespace: Telerik.Windows.Controls
Assembly: Telerik.Windows.Controls.dll
Syntax
public class DelegateCommand : Object, ICommand
Constructors
DelegateCommand(Action<Object>)
Initializes a new instance of the DelegateCommand class.
Declaration
public DelegateCommand(Action<object> execute)
Parameters
System.Action<System.Object>
execute
The execute action. |
DelegateCommand(Action<Object>, Predicate<Object>)
Initializes a new instance of the DelegateCommand class.
Declaration
public DelegateCommand(Action<object> execute, Predicate<object> canExecute)
Parameters
System.Action<System.Object>
execute
The execute action. |
System.Predicate<System.Object>
canExecute
The can execute predicate. |
Methods
CanExecute(Object)
Defines the method that determines whether the command can execute in its current state.
Declaration
public bool CanExecute(object parameter)
Parameters
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
System.Boolean
True if this command can be executed, otherwise - false. |
Execute(Object)
Defines the method to be called when the command is invoked.
Declaration
public void Execute(object parameter)
Parameters
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. |
InvalidateCanExecute()
Raises the CanExecuteChanged event.
Declaration
public void InvalidateCanExecute()
Events
CanExecuteChanged
Occurs when changes occur that affect whether the command should execute.
Declaration
public event EventHandler CanExecuteChanged
Event Type
System.EventHandler
|