mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-04 14:08:32 +00:00
Removed OpacityHelper
This commit is contained in:
parent
3afbdadf0c
commit
b9a34fd5e4
10 changed files with 144 additions and 171 deletions
32
MapControl/Avalonia/MapImageLayer.Avalonia.cs
Normal file
32
MapControl/Avalonia/MapImageLayer.Avalonia.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
||||
// Copyright © Clemens Fischer
|
||||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
public partial class MapImageLayer
|
||||
{
|
||||
public static void FadeOver(Image topImage, Image bottomImage)
|
||||
{
|
||||
var animation = new Animation
|
||||
{
|
||||
FillMode = FillMode.Forward,
|
||||
Duration = MapBase.ImageFadeDuration,
|
||||
Children =
|
||||
{
|
||||
new KeyFrame
|
||||
{
|
||||
KeyTime = MapBase.ImageFadeDuration,
|
||||
Setters = { new Setter(Visual.OpacityProperty, 1d) }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_ = animation.RunAsync(topImage).ContinueWith(
|
||||
_ => bottomImage.Opacity = 0d,
|
||||
TaskScheduler.FromCurrentSynchronizationContext());
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue