Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
How can I manually run a story board animation created in a blend WPF project using a code-behind file?
Posted
Updated 18-Oct-10 11:17am
v4
Comments
Sandeep Mewara 18-Oct-10 4:32am    
1. Not clear
2. Any effort?

This will work better in most cases :

C#
Storyboard myStoryboard = (Storyboard)(this.FindName("myStoryboard"));
myStoryboard.Begin();
 
Share this answer
 
Storyboard stbMove = (Storyboard)FindResource("storyboardname");
stbMove.Begin();
 
Share this answer
 
v2
Yes, You can. You need to set a Key (resource key) for your StoryBoard animation while designing a StoryBoard in XAML. Access it from codebehind using TryFindResource function. Then call BeginAnimation().
 
Share this answer
 
Comments
Dalek Dave 19-Oct-10 3:21am    
Good Call.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900