mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
31 lines
843 B
C#
31 lines
843 B
C#
using Avalonia.Animation;
|
|
using Avalonia.Styling;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MapControl
|
|
{
|
|
public partial class MapImageLayer
|
|
{
|
|
private void FadeOver()
|
|
{
|
|
var fadeInAnimation = new Animation
|
|
{
|
|
FillMode = FillMode.Forward,
|
|
Duration = MapBase.ImageFadeDuration,
|
|
Children =
|
|
{
|
|
new KeyFrame
|
|
{
|
|
KeyTime = MapBase.ImageFadeDuration,
|
|
Setters = { new Setter(OpacityProperty, 1d) }
|
|
}
|
|
}
|
|
};
|
|
|
|
_ = fadeInAnimation.RunAsync(Children[1]).ContinueWith(
|
|
_ => Children[0].Opacity = 0d,
|
|
TaskScheduler.FromCurrentSynchronizationContext());
|
|
}
|
|
}
|
|
}
|