summaryrefslogtreecommitdiff
path: root/Gestor.Application/ViewModels/Command/RelayCommand.cs
blob: fb3d646ab638b06af8b69b48a3468b2f48127cc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Windows.Input;

namespace Gestor.Application.ViewModels.Command
{
	public class RelayCommand : ICommand
	{
		private Action mAction;

		public RelayCommand(Action action)
		{
			this.mAction = action;
		}

		public bool CanExecute(object parameter)
		{
			return true;
		}

		public void Execute(object parameter)
		{
			this.mAction();
		}

		public event EventHandler CanExecuteChanged;
	}
}