Added UpdateTimer class

This commit is contained in:
ClemensFischer 2025-10-26 17:52:54 +01:00
parent 579631dd9d
commit 3fcb91f2d9
4 changed files with 38 additions and 32 deletions

View file

@ -0,0 +1,28 @@
#if WPF
using System.Windows.Threading;
#elif UWP
using Windows.UI.Xaml;
#elif WINUI
using Microsoft.UI.Xaml;
#elif AVALONIA
using Avalonia.Threading;
#endif
namespace MapControl
{
internal class UpdateTimer : DispatcherTimer
{
public void Run(bool restart = false)
{
if (restart)
{
Stop();
}
if (!IsEnabled)
{
Start();
}
}
}
}