20220510_191_upperpc/AutomaticApp/Base/Command.cs
2023-07-27 10:57:34 +08:00

29 lines
620 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace AutomaticApp.Base
{
public class Command : ICommand
{
public event EventHandler? CanExecuteChanged;
public bool CanExecute(object? parameter) => true;
public void Execute(object? parameter)
{
DoExecute?.Invoke(parameter);
}
public Action<object> DoExecute { get; set; }
public Command(Action<object> doExecute)
{
DoExecute = doExecute;
}
}
}