Class RelayCommand
Relay command using delegate command pattern
Inheritance
System.Object
RelayCommand
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: Simplic.UI.MVC
Assembly: Simplic.UI.dll
Syntax
public class RelayCommand : ICommand
Constructors
| Improve this Doc View SourceRelayCommand(Action<Object>)
Initialize new RelayCommand
Declaration
public RelayCommand(Action<object> execute)
Parameters
Type | Name | Description |
---|---|---|
System.Action<System.Object> | execute | Method to execute |
RelayCommand(Action<Object>, Predicate<Object>)
Initialize new RelayCommand
Declaration
public RelayCommand(Action<object> execute, Predicate<object> canExecute)
Parameters
Type | Name | Description |
---|---|---|
System.Action<System.Object> | execute | Method to execute |
System.Predicate<System.Object> | canExecute | Method to dertermine whether the command can be executed |
Methods
| Improve this Doc View SourceCanExecute(Object)
Execute the can-execute method to dertermine, whether the command can be executed
Declaration
public bool CanExecute(object parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parameter | Parameter object |
Returns
Type | Description |
---|---|
System.Boolean | True if the command can be executed |
Destroy()
Remove the command
Declaration
public void Destroy()
Execute(Object)
Execute the command and call the execute method
Declaration
public void Execute(object parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parameter | Parameter which will be passed to the method |
OnCanExecuteChanged()
Declaration
public void OnCanExecuteChanged()
Events
| Improve this Doc View SourceCanExecuteChanged
Adds or removes an event which will be called if can executed was changed
Declaration
public event EventHandler CanExecuteChanged
Event Type
Type | Description |
---|---|
System.EventHandler |
Implements
System.Windows.Input.ICommand