XAML-Map-Control/MapControl/Avalonia/MapImageLayer.Avalonia.cs

33 lines
954 B
C#
Raw Normal View History

2025-01-05 09:22:50 +01:00
// 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
{
2025-01-25 16:47:42 +01:00
private void FadeOver()
2025-01-05 09:22:50 +01:00
{
2025-01-05 10:31:15 +01:00
var fadeInAnimation = new Animation
2025-01-05 09:22:50 +01:00
{
FillMode = FillMode.Forward,
Duration = MapBase.ImageFadeDuration,
Children =
{
new KeyFrame
{
KeyTime = MapBase.ImageFadeDuration,
2025-01-24 23:04:59 +01:00
Setters = { new Setter(OpacityProperty, 1d) }
2025-01-05 09:22:50 +01:00
}
}
};
2025-01-25 16:47:42 +01:00
_ = fadeInAnimation.RunAsync(Children[1]).ContinueWith(
_ => Children[0].Opacity = 0d,
2025-01-05 09:22:50 +01:00
TaskScheduler.FromCurrentSynchronizationContext());
}
}
}