It seems I can't do myObject.BeginAnimation(dp , animation)
.
Is this a bug or has it been changed?
You need to use a storyboard. Add your animation to the storyboard and have the storyboard begin the animation.
var storyboard = new Storyboard();
var opacityAnimation = new DoubleAnimation {
From = 0,
To = 1,
Duration = DurationHelper.FromTimeSpan(TimeSpan.FromSeconds(1)),
};
storyboard.Children.Add(opacityAnimation);
Storyboard.SetTargetProperty(opacityAnimation, "Opacity");
Storyboard.SetTarget(storyboard, myObject);
storyboard.Begin();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With