mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-04 14:08:32 +00:00
Reset Tile.IsPending on request cancellation
This commit is contained in:
parent
c3386d1fbb
commit
545e49b306
5 changed files with 22 additions and 8 deletions
|
|
@ -20,7 +20,11 @@ namespace MapControl
|
|||
|
||||
tcs.TrySetResult(null); // tcs.Task has completed when image is loaded
|
||||
|
||||
if (!cancellationToken.IsCancellationRequested)
|
||||
if (cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
tile.IsPending = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
tile.SetImageSource(image);
|
||||
}
|
||||
|
|
@ -33,7 +37,7 @@ namespace MapControl
|
|||
|
||||
if (!await tile.Image.Dispatcher.TryRunAsync(CoreDispatcherPriority.Low, LoadTileImage))
|
||||
{
|
||||
tcs.TrySetCanceled();
|
||||
tcs.TrySetCanceled(cancellationToken);
|
||||
}
|
||||
|
||||
await tcs.Task;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue