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