hi,
this is koti well i think well known to many users of this site as koteswararao mallisetti here the issue is i am start the one double animation in one button click event it's work file when i stop the animation with another button clik event the animation object get into the original state not in the present state how can we get the current value of the animated object property in the second button click event how to get the current value of that animated object
this is my xaml code:
.cs file
Storyboard sb = new Storyboard();
public Window1()
{
InitializeComponent();
}
private void BtnDrop_Click(object sender, RoutedEventArgs e)
{
DoubleAnimation drop = new DoubleAnimation(247, new Duration(new TimeSpan(0, 0, 10)));
drop.To = 247;
Storyboard.SetTarget(drop, circ);
Storyboard.SetTargetProperty(drop, new PropertyPath(Canvas.TopProperty));
//Storyboard.SetTargetName(drop,circ.Name );
sb.Children.Add(drop);
sb.Begin();
//sb.BeginAnimation(Canvas.TopProperty , drop);
//circ.BeginAnimation(Canvas.TopProperty, drop);
}
private void BtnStop_Click(object sender, RoutedEventArgs e)
{
Canvas.SetTop(circ,Convert.ToDouble(sb.GetValue(Canvas.TopProperty)));
sb.Stop();
}
}
Loading
Replies
Know the answer? Post it — somebody with the same question will find it here.