Class RelayCommand
A Helper class to bind UI Events to simple Map methods.
Implements
Inherited Members
Namespace: OffRouteMap
Assembly: OffRouteMap.dll
Syntax
public class RelayCommand : ICommand
Constructors
| Edit this page View SourceRelayCommand(Action, Func<bool>)
Declaration
public RelayCommand(Action execute, Func<bool> canExecute = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Action | execute | |
| Func<bool> | canExecute |
Methods
| Edit this page View SourceCanExecute(object)
Defines the method that determines whether the command can execute in its current state.
Declaration
public bool CanExecute(object parameter)
Parameters
| Type | Name | Description |
|---|---|---|
| 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 |
|---|---|
| bool |
Execute(object)
Defines the method to be called when the command is invoked.
Declaration
public void Execute(object parameter)
Parameters
| Type | Name | Description |
|---|---|---|
| object | parameter | Data used by the command. If the command does not require data to be passed, this object can be set to null. |
Events
| Edit this page View SourceCanExecuteChanged
Occurs when changes occur that affect whether or not the command should execute.
Declaration
public event EventHandler CanExecuteChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |