mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
29 lines
649 B
C#
29 lines
649 B
C#
using System;
|
|
using System.Windows.Input;
|
|
|
|
namespace Flow.Launcher.ViewModel
|
|
{
|
|
public class RelayCommand : ICommand
|
|
{
|
|
private readonly Action<object> _action;
|
|
|
|
public RelayCommand(Action<object> action)
|
|
{
|
|
_action = action;
|
|
}
|
|
|
|
public virtual bool CanExecute(object parameter)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
#pragma warning disable CS0067 // the event is never used
|
|
public event EventHandler CanExecuteChanged;
|
|
#pragma warning restore CS0067
|
|
|
|
public virtual void Execute(object parameter)
|
|
{
|
|
_action?.Invoke(parameter);
|
|
}
|
|
}
|
|
}
|