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