mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 06:26:41 +00:00
Use local function
This commit is contained in:
parent
f4d43eeb44
commit
3d6fc375b2
2 changed files with 30 additions and 28 deletions
|
|
@ -14,24 +14,25 @@ namespace MapControl
|
|||
{
|
||||
var image = await loadImageFunc().ConfigureAwait(false);
|
||||
|
||||
await Image.Dispatcher.InvokeAsync(
|
||||
() =>
|
||||
{
|
||||
Image.Source = image;
|
||||
void SetImageSource()
|
||||
{
|
||||
Image.Source = image;
|
||||
|
||||
if (image != null && MapBase.ImageFadeDuration > TimeSpan.Zero)
|
||||
if (image != null && MapBase.ImageFadeDuration > TimeSpan.Zero)
|
||||
{
|
||||
if (image is BitmapSource bitmap && !bitmap.IsFrozen && bitmap.IsDownloading)
|
||||
{
|
||||
if (image is BitmapSource bitmap && !bitmap.IsFrozen && bitmap.IsDownloading)
|
||||
{
|
||||
bitmap.DownloadCompleted += BitmapDownloadCompleted;
|
||||
bitmap.DownloadFailed += BitmapDownloadFailed;
|
||||
}
|
||||
else
|
||||
{
|
||||
BeginFadeInAnimation();
|
||||
}
|
||||
bitmap.DownloadCompleted += BitmapDownloadCompleted;
|
||||
bitmap.DownloadFailed += BitmapDownloadFailed;
|
||||
}
|
||||
});
|
||||
else
|
||||
{
|
||||
BeginFadeInAnimation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await Image.Dispatcher.InvokeAsync(SetImageSource);
|
||||
}
|
||||
|
||||
private void BeginFadeInAnimation()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue