Verzeichnisse umgeräumt

This commit is contained in:
2023-04-13 09:24:40 +02:00
parent 1d649d14cb
commit 047e036442
99 changed files with 8 additions and 1930 deletions

View File

@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace SewerStammGen.WPF.Commands
{
internal abstract class AsyncCommandBase : ICommand
{
bool _isExecuting = false;
public event EventHandler? CanExecuteChanged;
public bool IsExecuting
{
get => _isExecuting;
set
{
_isExecuting = value;
CanExecuteChanged?.Invoke(this, new EventArgs());
}
}
protected void OnCanExecuteChanged()
{
CanExecuteChanged?.Invoke(this, new EventArgs());
}
public virtual bool CanExecute(object? parameter)
{
return !IsExecuting;
}
public async void Execute(object? parameter)
{
IsExecuting = true;
await ExecuteAsync(parameter);
IsExecuting = false;
}
public abstract Task ExecuteAsync(object? parameter);
}
}