2025-02-27 18:46:32 +01:00
|
|
|
|
using System;
|
2025-01-05 09:22:50 +01:00
|
|
|
|
#if UWP
|
|
|
|
|
|
using Windows.UI.Xaml.Media.Animation;
|
|
|
|
|
|
#else
|
|
|
|
|
|
using Microsoft.UI.Xaml.Media.Animation;
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
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 DoubleAnimation
|
2025-01-05 09:22:50 +01:00
|
|
|
|
{
|
|
|
|
|
|
To = 1d,
|
|
|
|
|
|
Duration = MapBase.ImageFadeDuration
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2025-01-05 10:31:15 +01:00
|
|
|
|
var fadeOutAnimation = new DoubleAnimation
|
2025-01-05 09:22:50 +01:00
|
|
|
|
{
|
|
|
|
|
|
To = 0d,
|
|
|
|
|
|
BeginTime = MapBase.ImageFadeDuration,
|
2025-01-24 23:04:59 +01:00
|
|
|
|
Duration = TimeSpan.Zero
|
2025-01-05 09:22:50 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
2025-01-25 16:47:42 +01:00
|
|
|
|
Storyboard.SetTarget(fadeInAnimation, Children[1]);
|
2025-01-05 10:31:15 +01:00
|
|
|
|
Storyboard.SetTargetProperty(fadeInAnimation, nameof(Opacity));
|
2025-01-05 09:22:50 +01:00
|
|
|
|
|
2025-01-25 16:47:42 +01:00
|
|
|
|
Storyboard.SetTarget(fadeOutAnimation, Children[0]);
|
2025-01-05 10:31:15 +01:00
|
|
|
|
Storyboard.SetTargetProperty(fadeOutAnimation, nameof(Opacity));
|
2025-01-05 09:22:50 +01:00
|
|
|
|
|
|
|
|
|
|
var storyboard = new Storyboard();
|
2025-01-05 10:31:15 +01:00
|
|
|
|
storyboard.Children.Add(fadeInAnimation);
|
|
|
|
|
|
storyboard.Children.Add(fadeOutAnimation);
|
2025-01-05 09:22:50 +01:00
|
|
|
|
storyboard.Begin();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|