Commit | Line | Data |
---|---|---|
491f6e3b S |
1 | using System; |
2 | using System.Windows.Input; | |
3 | ||
a5a62e8d S |
4 | namespace SpeedportHybridControl.Implementations |
5 | { | |
6 | public class DelegateCommand : ICommand | |
7 | { | |
8 | private Action _executeMethod; | |
491f6e3b | 9 | |
a5a62e8d S |
10 | public DelegateCommand(Action executeMethod) |
11 | { | |
12 | _executeMethod = executeMethod; | |
13 | } | |
491f6e3b | 14 | |
a5a62e8d S |
15 | public bool CanExecute(object parameter = null) |
16 | { | |
17 | return true; | |
18 | } | |
491f6e3b | 19 | |
a5a62e8d | 20 | public event EventHandler CanExecuteChanged; |
491f6e3b | 21 | |
a5a62e8d S |
22 | public void Execute(object parameter = null) |
23 | { | |
24 | _executeMethod.Invoke(); | |
25 | } | |
26 | } | |
491f6e3b | 27 | } |