Animation FillBehavior

This commit is contained in:
ClemensFischer 2025-01-24 23:04:59 +01:00
parent 5856223e17
commit 2d6b2eb2aa
4 changed files with 9 additions and 14 deletions

View file

@ -19,7 +19,7 @@ namespace MapControl
new KeyFrame
{
KeyTime = MapBase.ImageFadeDuration,
Setters = { new Setter(Visual.OpacityProperty, 1d) }
Setters = { new Setter(OpacityProperty, 1d) }
}
}
};

View file

@ -137,8 +137,7 @@ namespace MapControl
{
To = new Location(targetCenter.Latitude, CoerceLongitude(targetCenter.Longitude)),
Duration = AnimationDuration,
EasingFunction = AnimationEasingFunction,
FillBehavior = FillBehavior.Stop
EasingFunction = AnimationEasingFunction
};
centerAnimation.Completed += CenterAnimationCompleted;
@ -154,9 +153,9 @@ namespace MapControl
centerAnimation.Completed -= CenterAnimationCompleted;
centerAnimation = null;
BeginAnimation(CenterProperty, null);
SetValueInternal(CenterProperty, TargetCenter);
UpdateTransform();
BeginAnimation(CenterProperty, null);
}
}
@ -202,8 +201,7 @@ namespace MapControl
{
To = targetZoomLevel,
Duration = AnimationDuration,
EasingFunction = AnimationEasingFunction,
FillBehavior = FillBehavior.Stop
EasingFunction = AnimationEasingFunction
};
zoomLevelAnimation.Completed += ZoomLevelAnimationCompleted;
@ -219,9 +217,9 @@ namespace MapControl
zoomLevelAnimation.Completed -= ZoomLevelAnimationCompleted;
zoomLevelAnimation = null;
BeginAnimation(ZoomLevelProperty, null);
SetValueInternal(ZoomLevelProperty, TargetZoomLevel);
UpdateTransform(true);
BeginAnimation(ZoomLevelProperty, null);
}
}
@ -262,8 +260,7 @@ namespace MapControl
{
By = delta,
Duration = AnimationDuration,
EasingFunction = AnimationEasingFunction,
FillBehavior = FillBehavior.Stop
EasingFunction = AnimationEasingFunction
};
headingAnimation.Completed += HeadingAnimationCompleted;
@ -279,9 +276,9 @@ namespace MapControl
headingAnimation.Completed -= HeadingAnimationCompleted;
headingAnimation = null;
BeginAnimation(HeadingProperty, null);
SetValueInternal(HeadingProperty, TargetHeading);
UpdateTransform();
BeginAnimation(HeadingProperty, null);
}
}
}

View file

@ -22,8 +22,7 @@ namespace MapControl
{
To = 0d,
BeginTime = MapBase.ImageFadeDuration,
Duration = TimeSpan.Zero,
FillBehavior = FillBehavior.Stop
Duration = TimeSpan.Zero
};
topImage.BeginAnimation(OpacityProperty, fadeInAnimation);

View file

@ -27,8 +27,7 @@ namespace MapControl
{
To = 0d,
BeginTime = MapBase.ImageFadeDuration,
Duration = TimeSpan.Zero,
FillBehavior = FillBehavior.Stop
Duration = TimeSpan.Zero
};
Storyboard.SetTargetProperty(fadeInAnimation, nameof(Opacity));