mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-09 00:14:51 +00:00
Remove DispatcherTimerExtensions
This commit is contained in:
parent
96d4af1881
commit
2f6f7ee4eb
3 changed files with 29 additions and 53 deletions
|
|
@ -62,7 +62,7 @@ namespace MapControl
|
|||
|
||||
loadingProgress = new Progress<double>(p => SetValue(LoadingProgressProperty, p));
|
||||
|
||||
updateTimer = this.CreateTimer(UpdateInterval);
|
||||
updateTimer = new DispatcherTimer { Interval = UpdateInterval };
|
||||
updateTimer.Tick += async (s, e) => await UpdateImageAsync();
|
||||
}
|
||||
|
||||
|
|
@ -164,7 +164,15 @@ namespace MapControl
|
|||
}
|
||||
else
|
||||
{
|
||||
updateTimer.Run(!UpdateWhileViewportChanging);
|
||||
if (!UpdateWhileViewportChanging)
|
||||
{
|
||||
updateTimer.Stop();
|
||||
}
|
||||
|
||||
if (!updateTimer.IsEnabled)
|
||||
{
|
||||
updateTimer.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -174,9 +182,12 @@ namespace MapControl
|
|||
{
|
||||
if (updateInProgress)
|
||||
{
|
||||
// Update image on next tick, start timer if not running.
|
||||
// Update image on next timer tick.
|
||||
//
|
||||
updateTimer.Run();
|
||||
if (!updateTimer.IsEnabled)
|
||||
{
|
||||
updateTimer.Start();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue