tags:

views:

9

answers:

1

Control type is Border, Control name is brdMessage. How can i make a storyboard to fade in my control (opacity from 0 to 1) in the first 3 seconds, then nothing happens in the next 3 seconds and then a fade out (opacity from 1 to 0) the control in the following 3 seconds? (can you please provide answers in c# code and not xaml). Thanks.

A: 

I figured it out with the autoreverse , however, how to pause it before reversing?

Storyboard sb = new Storyboard(); DoubleAnimation da = new DoubleAnimation(); da.To = 1; da.Duration = new Duration(TimeSpan.FromSeconds(3)); sb.Children.Add(da); Storyboard.SetTarget(da, brdStatus); Storyboard.SetTargetProperty(da, new PropertyPath("Opacity")); txtMessage.Text = msg; sb.AutoReverse = true; sb.Begin();

Zee99