20241106_MiLu_upperpc/DeerProject/Base/Command.cs

29 lines
611 B
C#
Raw Permalink Normal View History

2025-02-20 05:54:12 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace DeerProject.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;
}
}
}