2017-08-04 21:38:58 +02:00
|
|
|
|
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
2024-02-03 21:01:53 +01:00
|
|
|
|
// Copyright © 2024 Clemens Fischer
|
2017-08-04 21:38:58 +02:00
|
|
|
|
// Licensed under the Microsoft Public License (Ms-PL)
|
|
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Threading.Tasks;
|
2022-11-20 18:51:59 +01:00
|
|
|
|
using System.Windows.Media;
|
2017-08-04 21:38:58 +02:00
|
|
|
|
|
|
|
|
|
|
namespace MapControl
|
|
|
|
|
|
{
|
2018-08-08 23:31:52 +02:00
|
|
|
|
public partial class TileImageLoader
|
2017-08-04 21:38:58 +02:00
|
|
|
|
{
|
2023-08-19 17:48:52 +02:00
|
|
|
|
private static async Task LoadTileAsync(Tile tile, Func<Task<ImageSource>> loadImageFunc)
|
2018-08-21 23:56:54 +02:00
|
|
|
|
{
|
2022-11-20 18:51:59 +01:00
|
|
|
|
var image = await loadImageFunc().ConfigureAwait(false);
|
2018-08-21 23:56:54 +02:00
|
|
|
|
|
2022-11-17 23:11:40 +01:00
|
|
|
|
await tile.Image.Dispatcher.InvokeAsync(() => tile.SetImageSource(image));
|
2017-08-04 21:38:58 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|