- tweak: refactor funny

This commit is contained in:
2025-01-05 17:05:23 +03:00
parent 5b24f915a2
commit 8619e248fd
67 changed files with 485 additions and 492 deletions

View File

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