initial commit
[GitHub/mt8127/ROM0Split.git] / ROM0Split / Implementations / DelegateCommand.cs
CommitLineData
3004d53f
JA
1using System;
2using System.Windows.Input;
3
4namespace 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}