Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Animation in CodeBehind just works once.

$
0
0

hey,

i've coded following Animation:

TextBlock block = child as TextBlock;
block.Visibility = Visibility.Visible;
animate = new ObjectAnimationUsingKeyFrames();
animate.FillBehavior = FillBehavior.HoldEnd;
animate.AutoReverse = false;
animate.Duration = new TimeSpan(0, 0, 0, 3);
DiscreteObjectKeyFrame kf1 = new DiscreteObjectKeyFrame(Visibility.Hidden, new TimeSpan(0, 0, 0, 3));
animate.KeyFrames.Add(kf1);
block.BeginAnimation(TextBlock.VisibilityProperty, animate);

This Animation works just one time and after this it doesn't do it again, why?? 

Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>