Init commit

This commit is contained in:
NickAppLab
2022-06-13 21:24:13 +05:00
commit 60eb406cbe
42 changed files with 3806 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
using System;
using System.Windows.Input;
namespace StructureHelper
{
public class RelayCommand : ICommand
{
private Action<object> execute;
private Func<object, bool> canExecute;
public event EventHandler CanExecuteChanged
{
add => CommandManager.RequerySuggested += value;
remove => CommandManager.RequerySuggested -= value;
}
public RelayCommand(Action<object> execute, Func<object, bool> canExecute = null)
{
this.execute = execute;
this.canExecute = canExecute;
}
public bool CanExecute(object parameter) => canExecute == null || canExecute(parameter);
public void Execute(object parameter) => execute(parameter);
}
}