using System.Windows.Input; namespace Nebula.Shared.Utils; public class DelegateCommand : ICommand { private readonly Action _func; public readonly Ref TRef = new(); public DelegateCommand(Action func) { _func = func; } public bool CanExecute(object? parameter) { return true; } public void Execute(object? parameter) { _func(TRef.Value); } public event EventHandler? CanExecuteChanged; }