You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
774 B
C#

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