mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Update Tile class
This commit is contained in:
parent
caf6a9c8a4
commit
5c17a1c36f
4 changed files with 26 additions and 42 deletions
|
|
@ -239,7 +239,7 @@ namespace MapControl
|
|||
|
||||
if (equivalentTile != null)
|
||||
{
|
||||
tile.SetImageSource(equivalentTile);
|
||||
tile.SetImageSource(equivalentTile.Image.Source, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
// © 2022 Clemens Fischer
|
||||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
using System;
|
||||
#if WINUI
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
|
|
@ -52,14 +53,22 @@ namespace MapControl
|
|||
|
||||
public bool Pending { get; set; } = true;
|
||||
|
||||
public void SetImageSource(Tile tile)
|
||||
public void SetImageSource(ImageSource image, bool animateOpacity = true)
|
||||
{
|
||||
Pending = false;
|
||||
Image.Opacity = 1d;
|
||||
Image.Source = tile.Image.Source;
|
||||
Image.Source = image;
|
||||
|
||||
if (image != null && animateOpacity && MapBase.ImageFadeDuration > TimeSpan.Zero)
|
||||
{
|
||||
AnimateImageOpacity();
|
||||
}
|
||||
else
|
||||
{
|
||||
Image.Opacity = 1d;
|
||||
}
|
||||
}
|
||||
|
||||
private void FadeIn()
|
||||
private void BeginOpacityAnimation()
|
||||
{
|
||||
Image.BeginAnimation(UIElement.OpacityProperty, new DoubleAnimation
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue