23 lines
550 B
C#
23 lines
550 B
C#
|
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);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|