mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-09 00:14:51 +00:00
Added UpdateTimer class
This commit is contained in:
parent
579631dd9d
commit
3fcb91f2d9
4 changed files with 38 additions and 32 deletions
28
MapControl/Shared/UpdateTimer.cs
Normal file
28
MapControl/Shared/UpdateTimer.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue