refactor: 将Framework库和RT、UI放在同一个解决方案中。

This commit is contained in:
SL
2026-06-01 17:48:28 +08:00
parent 1948f4290d
commit b73d39a6b1
4331 changed files with 506148 additions and 49363 deletions
+49
View File
@@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace SicUI.Controls.Common
{
public class RelayCommand : ICommand
{
private readonly Func<Object, Boolean> canExecute;
private readonly Action<Object> execute;
public RelayCommand(Action<Object> execute) : this(execute, null)
{
}
public RelayCommand(Action<Object> execute, Func<Object, Boolean> canExecute)
{
this.execute = execute ?? throw new ArgumentNullException("execute");
this.canExecute = canExecute;
}
public event EventHandler CanExecuteChanged
{
add
{
if (canExecute != null)
CommandManager.RequerySuggested += value;
}
remove
{
if (canExecute != null)
CommandManager.RequerySuggested -= value;
}
}
public Boolean CanExecute(Object parameter)
{
return canExecute == null ? true : canExecute(parameter);
}
public void Execute(Object parameter)
{
execute(parameter);
}
}
}