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">
 
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
In the  code behind I have written
 
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.