20240301_JSEQ_upperpc/JiangsuEarthquakeJM/JiangsuEarthquake/Base/Command.cs

29 lines
617 B
C#
Raw Permalink Normal View History

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace JiangsuEarthquake.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;
}
}
}