Reset Tile.IsPending on request cancellation

This commit is contained in:
ClemensFischer 2025-08-20 17:48:39 +02:00
parent c3386d1fbb
commit 545e49b306
5 changed files with 22 additions and 8 deletions

View file

@ -11,7 +11,11 @@ namespace MapControl
{
var image = await loadImageFunc().ConfigureAwait(false);
if (!cancellationToken.IsCancellationRequested)
if (cancellationToken.IsCancellationRequested)
{
tile.IsPending = true;
}
else
{
_ = tile.Image.Dispatcher.InvokeAsync(() => tile.SetImageSource(image)); // no need to await InvokeAsync
}