Flow.Launcher/Flow.Launcher/ViewModel/RelayCommand.cs
Oren Nachman 3648126854 Revert JSON Null change + fix more warnings
See comment inline re:JSON null
2022-08-08 17:35:38 -07:00

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);
}
}
}