Toolkit.UI.Controls.Avalonia

This commit is contained in:
TheXamlGuy
2024-04-13 11:41:33 +01:00
parent 62a7e94e19
commit 862e7b2e34
97 changed files with 8558 additions and 0 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,22 @@
using Avalonia.Threading;
namespace Toolkit.UI.Controls.Avalonia;
public class ScopedBatchHelper
{
private DispatcherTimer? timer;
public Action? Completed { get; set; }
public void Start(TimeSpan duration)
{
timer ??= new DispatcherTimer(duration, DispatcherPriority.Background, Tick);
timer.Start();
}
private void Tick(object? sender, EventArgs args)
{
timer?.Stop();
Completed?.Invoke();
Completed = null;
}
}