AutoCatUwp/AutoCatCore/MVVM/RelayCommand.cs
2021-01-24 18:21:04 +03:00

38 lines
703 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace AutoCat.MVVM
{
public class RelayCommand : ICommand
{
private Action action;
public RelayCommand(Action action)
{
this.action = action;
}
#region ICommand Members
public bool CanExecute(object parameter)
{
return true;
}
#pragma warning disable 67
public event EventHandler CanExecuteChanged;
#pragma warning restore 67
public void Execute(object parameter)
{
action();
}
#endregion
}
}