Skip to content
Discussion options

You must be logged in to vote

chat gpt helped out! Thanks anw.

// Create the DoubleAnimation for the Y-axis translation
DoubleAnimation translateYAnimation = new DoubleAnimation
{
				To = 0,
				From = 100,
				Duration = GetAnimationDuration(element),
				FillBehavior = FillBehavior.HoldEnd // Keeps the translated position after animation completes
};

// Create a Storyboard and add the animation to it
Storyboard storyboard = new Storyboard();
storyboard.Children.Add(translateYAnimation);

// Set the target property and target element for the animation
Storyboard.SetTarget(translateYAnimation, element);
Storyboard.SetTargetProperty(translateYAnimation, "(UIElement.RenderTransform).(TranslateTransform.Y)");

// Check…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jeromelaban
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant