FieldWorkClient/Models/CustomCommand.cs

25 lines
424 B
C#

using System.Windows.Input;
namespace Hopetry.Models;
public class CustomCommand : ICommand
{
private readonly Action _execute;
public CustomCommand(Action execute)
{
_execute = execute;
}
public bool CanExecute(object parameter)
{
return true;
}
public event EventHandler CanExecuteChanged;
public void Execute(object parameter)
{
_execute();
}
}