I have written an animation in WPF storyboard: The following is the code:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
public void AnimateRectangle()
{
Storyboard rectrotate = (Storyboard)FindResource("Storyboard1");
rectrotate.Begin();
}
I call this function on button click event.
When I click the button nothing happens.
Please help.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Madhukar KrishnaRank #1,382 · 1.2K reputationPosted May 5, 2014, 8:43 AM EDT
Madhukar KrishnaRank #1,382 · 1.2K reputationPosted May 11, 2014, 7:24 PM EDT
IFound out that FillBehavior="Stop" should be used to bring the timeline back to zero
I can also use Autoreverse to true but that also reverses the animation
thanks for all the help