Finish LoadingSpinner

This commit is contained in:
Natlinux81
2022-08-28 01:58:33 +02:00
parent 7fe2fd08ea
commit dfe0f72d04
20 changed files with 181 additions and 85 deletions

View File

@@ -8,13 +8,35 @@ namespace Apollon.WPF.Commands
{
public abstract class AsyncCommandBase : CommandBase
{
private bool _isExecuring;
public bool IsExecuting
{
get
{
return _isExecuring;
}
set
{
_isExecuring = value;
OnCanExecutedChanged();
}
}
public override bool CanExecute(object parameter)
{
return !IsExecuting && base.CanExecute(parameter);
}
public override async void Execute(object parameter)
{
IsExecuting = true;
try
{
await ExecuteAsync(parameter);
}
catch (Exception) { }
catch (Exception) { }
finally
{
IsExecuting = false;
}
}
public abstract Task ExecuteAsync(object parameter);
}