mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-04 22:18:56 +00:00
Reverted request cancellation in TileImageLoader
This commit is contained in:
parent
00a885b654
commit
775d584df7
8 changed files with 35 additions and 87 deletions
|
|
@ -7,18 +7,11 @@ namespace MapControl
|
|||
{
|
||||
public partial class TileImageLoader
|
||||
{
|
||||
private static async Task LoadTileImage(Tile tile, Func<Task<ImageSource>> loadImageFunc, CancellationToken cancellationToken)
|
||||
private static async Task LoadTileImage(Tile tile, Func<Task<ImageSource>> loadImageFunc)
|
||||
{
|
||||
var image = await loadImageFunc().ConfigureAwait(false);
|
||||
|
||||
if (cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
tile.IsPending = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_ = tile.Image.Dispatcher.InvokeAsync(() => tile.SetImageSource(image)); // no need to await InvokeAsync
|
||||
}
|
||||
await tile.Image.Dispatcher.InvokeAsync(() => tile.SetImageSource(image));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue