Click here to Skip to main content
15,890,973 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
this is my code

public partial class MainWindow : Window
   {
       private Storyboard myStoryboard;
       private Storyboard myStoryboard2;
       public MainWindow()
       {
           InitializeComponent();
           //animation for the hide
           ThicknessAnimation myDoubleAnimation = new ThicknessAnimation();
           myDoubleAnimation.From = (textBlock3.Margin = new Thickness(378, 0, 0, 0));
           myDoubleAnimation.From = (SV.Margin = new Thickness(413, 0, 0, 0));
           myDoubleAnimation.To = (textBlock3.Margin = new Thickness(28, 0, 0, 0));
           myDoubleAnimation.To = (SV.Margin = new Thickness(35, 0, 0, 0));
           myDoubleAnimation.Duration = new Duration(TimeSpan.FromSeconds(0.5));
           myStoryboard = new Storyboard();
           myStoryboard.Children.Add(myDoubleAnimation);
           Storyboard.SetTargetName(myDoubleAnimation, textBlock3.Name);
           Storyboard.SetTargetProperty(myDoubleAnimation, new PropertyPath(Rectangle.MarginProperty));
           //animation for the show
           ThicknessAnimation myDoubleAnimation2 = new ThicknessAnimation();
           myDoubleAnimation2.From = (Margin = new Thickness(28, 0, 0, 0));
           myDoubleAnimation2.To = (Margin = new Thickness(378, 0, 0, 0));
           myDoubleAnimation2.Duration = new Duration(TimeSpan.FromSeconds(0.5));
           myStoryboard2 = new Storyboard();
           myStoryboard2.Children.Add(myDoubleAnimation2);
           Storyboard.SetTargetName(myDoubleAnimation2, textBlock3.Name);
           Storyboard.SetTargetProperty(myDoubleAnimation2, new PropertyPath(Rectangle.MarginProperty));

       }


now i just want 2 animations going at the same time, but with i do this code, nothing moves
Posted

1 solution

No, it won't. I a, not sure if you can run two storyboards at once, or if they need to be in the same storyboard. I do know you need to start it.

Here[^]
 
Share this answer
 
Comments
Venkatesh Mookkan 13-Jul-11 0:42am    
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