Click here to Skip to main content
15,041,548 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?

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().
   
Comments
Dalek Dave 19-Oct-10 3:21am
   
Good Call.
This will work better in most cases :

C#
Storyboard myStoryboard = (Storyboard)(this.FindName("myStoryboard"));
myStoryboard.Begin();
   
Storyboard stbMove = (Storyboard)FindResource("storyboardname");
stbMove.Begin();
   
v2

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