EPLAN_PROD_Plugin/Sinvo.EplanHpD.Plugin.WPFUI/Commands/UICommand.cs

23 lines
550 B
C#
Raw Normal View History

2024-10-24 18:01:26 +08:00
using System;
using System.Windows.Input;
namespace Sinvo.EplanHpD.Plugin.WPFUI.Commands
{
public class UICommand : ICommand
{
private readonly Action<object> _execute;
private readonly Func<object, bool> _canExecute;
public event EventHandler CanExecuteChanged;
public bool CanExecute(object parameter)
{
return _canExecute != null || _canExecute(parameter);
}
public void Execute(object parameter)
{
_execute.Invoke(parameter);
}
}
}