20240801_FJEQ_upperpc/FujianEarthquake_seabed/FujianEarthquake/Common/CommandBase.cs
XuMin 9d9eebd854 海底部分上位机软件:
1 基本框架搭建完成;
2 日志记录展示页面完成;
3 实时数据展示页面和告警记录页面完成部分;
2024-08-22 17:45:36 +08:00

34 lines
771 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace FujianEarthquake.Common
{
public class CommandBase : ICommand
{
public event EventHandler CanExecuteChanged;
public bool CanExecute(object parameter)
{
return DoCanExcute?.Invoke(parameter) == true;
}
public void Execute(object parameter)
{
DoExcute?.Invoke(parameter);
}
public Action<object> DoExcute { set; get; }
public Func<object, bool> DoCanExcute { set; get; }
public void RaiseCanExecuteChanged()
{
CanExecuteChanged?.Invoke(this, new EventArgs());
}
}
}