30 lines
601 B
C#
30 lines
601 B
C#
using System.Windows.Input;
|
|
|
|
namespace YwxApp.AiChat.Commands
|
|
{
|
|
|
|
/// <summary>
|
|
/// relay command
|
|
/// </summary>
|
|
public class ParameterlessCommand : ICommand
|
|
{
|
|
private Action _execute;
|
|
public ParameterlessCommand(Action execute)
|
|
{
|
|
_execute = execute;
|
|
}
|
|
public event EventHandler? CanExecuteChanged;
|
|
|
|
public bool CanExecute(object? parameter)
|
|
{
|
|
return CanExecuteChanged != null;
|
|
}
|
|
|
|
public void Execute(object? parameter)
|
|
{
|
|
_execute.Invoke();
|
|
}
|
|
}
|
|
}
|
|
|