Aufgabe Timer in Titel

This commit is contained in:
2025-06-02 16:11:50 +02:00
parent 80d64c9574
commit 3f2bd74438
4 changed files with 123 additions and 2 deletions

View File

@@ -0,0 +1,44 @@
namespace FahzeugWPF;
using System.Diagnostics;
using System.Windows.Input;
public class RelayCommand : ICommand
{
readonly Action<object> _execute = null;
readonly Predicate<object> _canExecute = null;
public RelayCommand(Action<object> execute)
: this(execute, null)
{
// Nothing to do
}
public RelayCommand(Action<object> execute, Predicate<object> canExecute)
{
if (execute == null)
{
throw new ArgumentNullException("execute");
}
this._execute = execute;
this._canExecute = canExecute;
}
[DebuggerStepThrough]
public bool CanExecute(object parameter)
{
return _canExecute == null ? true : _canExecute(parameter);
}
public event EventHandler CanExecuteChanged
{
add { CommandManager.RequerySuggested += value; }
remove { CommandManager.RequerySuggested -= value; }
}
public void Execute(object parameter)
{
_execute(parameter);
}
}