This commit is contained in:
dan_clark@outlook.com
2022-03-23 15:44:32 +00:00
commit 2ac0e3ed26
129 changed files with 4197 additions and 0 deletions
@@ -0,0 +1,37 @@
using System;
using TheXamlGuy.TaskbarGroup.Core;
namespace TheXamlGuy.TaskbarGroup.Foundation
{
public class DispatcherTimer : IDispatcherTimer
{
private readonly System.Windows.Threading.DispatcherTimer timer;
private readonly Action actionDelegate;
public DispatcherTimer(Action actionDelegate, TimeSpan interval)
{
timer = new System.Windows.Threading.DispatcherTimer
{
Interval = interval
};
timer.Tick += OnTick;
this.actionDelegate = actionDelegate;
}
private void OnTick(object? sender, EventArgs args)
{
actionDelegate?.Invoke();
}
public void Start()
{
timer.Start();
}
public void Stop()
{
timer.Stop();
}
}
}