mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Simplified Tile class
This commit is contained in:
parent
7b404446d2
commit
7d78d2587e
4 changed files with 13 additions and 14 deletions
|
|
@ -40,26 +40,22 @@ namespace MapControl
|
|||
|
||||
public Image Image { get; } = new Image
|
||||
{
|
||||
Opacity = 0d,
|
||||
Stretch = Stretch.Fill,
|
||||
IsHitTestVisible = false // avoid touch capture issues
|
||||
};
|
||||
|
||||
public bool IsPending { get; set; } = true;
|
||||
|
||||
public void SetImageSource(ImageSource image, bool animateOpacity = true)
|
||||
public void SetImageSource(ImageSource image)
|
||||
{
|
||||
IsPending = false;
|
||||
Image.Source = image;
|
||||
|
||||
if (image != null && animateOpacity && MapBase.ImageFadeDuration > TimeSpan.Zero)
|
||||
if (image != null && MapBase.ImageFadeDuration > TimeSpan.Zero)
|
||||
{
|
||||
AnimateImageOpacity();
|
||||
}
|
||||
else
|
||||
{
|
||||
Image.Opacity = 1d;
|
||||
AnimateImageOpacity(image);
|
||||
}
|
||||
|
||||
Image.Source = image;
|
||||
}
|
||||
|
||||
private void BeginOpacityAnimation()
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@ namespace MapControl
|
|||
|
||||
if (equivalentTile != null)
|
||||
{
|
||||
tile.SetImageSource(equivalentTile.Image.Source, false); // no opacity animation
|
||||
tile.IsPending = false;
|
||||
tile.Image.Source = equivalentTile.Image.Source; // no opacity animation
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue