This repository has been archived on 2024-06-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
thesis-src/Examples/GUI/Model/Command.cs
2023-08-10 09:04:36 +02:00

34 lines
509 B
C#

using System;
using System.Windows.Input;
namespace GUI.Model;
public class Command : ICommand
{
public Action Action { get; set; }
public Command(Action action)
{
Action = action;
}
#region Implementation of ICommand
/// <inheritdoc />
public bool CanExecute(object? parameter)
{
return true;
}
/// <inheritdoc />
public void Execute(object? parameter)
{
Action?.Invoke();
}
/// <inheritdoc />
public event EventHandler? CanExecuteChanged;
#endregion
}