c# - How to restrict storyboard to begin automatically in Windows 8 store app? -


I am using two storyboards, left balls (image) and right direction, at the tap event of the left button I want to go in the direction of the balls and the right button tap in the left direction, the balls should be taken in the right direction. It is working correctly on tapping the left and right buttons, but the loading app starts automatically on the storyboard and moves one step to one place without tapping the balls. How do I start the storyboard automatically?

This is my first storyboard to move the balls in the left direction:

  & lt; EventTrigger & gt; & Lt; BeginStoryboard & gt; & Lt; Storyboard x: name = "balderbybyte" & gt; & Lt; Double animation storyboard TargetName = "balltrans" storyboard. TargetProperty = "translationX" period = "0: 0: 0.5" by = "- 40" FillBehavior = "holdand"> & Lt; DoubleAnimation.EasingFunction & gt; & Lt; Elastic Is Oscillation = "0" Springness = "1" /> & Lt; /DoubleAnimation.EasingFunction> & Lt; / DoubleAnimation & gt; & Lt; / Storyboard & gt; & Lt; / BeginStoryboard & gt; & Lt; / EventTrigger & gt;   

This is my second storyboard to move 40 pixels in the right direction:

   & Lt; /DoubleAnimation.EasingFunction> & Lt; / DoubleAnimation & gt; & Lt; / Storyboard & gt; & Lt; / BeginStoryboard & gt; & Lt; / EventTrigger & gt;   

I have written the code behind this code:

  Private zero imgLftpatted (object sender, transited event time e) {ballstoryleft.Beggin (); } Private zero imgright_Tapped (Object Sender, TappedRoutedEventArgs e) {ballstoryright.Begin (); }    

Where have you placed your storyboard ? I think they are inside event triggers

you should put storyboard in a resource collection:

Page.Resources> pre & lt; & Lt; Storyboard x: name = "balderbybyte" & gt; & Lt; Double animation storyboard TargetName = "balltrans" storyboard. TargetProperty = "translationX" period = "0: 0: 0.5" by = "- 40" FillBehavior = "holdand"> & Lt; DoubleAnimation.EasingFunction & gt; & Lt; Elastic Is Oscillation = "0" Springness = "1" /> & Lt; /DoubleAnimation.EasingFunction> & Lt; / DoubleAnimation & gt; & Lt; / Storyboard & gt; & Lt; Storyboard x: name = "balustromatic" & gt; & Lt; Double animation storyboard TargetName = "balltrans" storyboard. TargetProperty = "TranslateX" period = "0: 0: 0.5" by = "40" FillBehavior = "Holdend" & gt; & Lt; DoubleAnimation.EasingFunction & gt; & Lt; Elastic Is Oscillation = "0" Springness = "1" /> & Lt; /DoubleAnimation.EasingFunction> & Lt; / DoubleAnimation & gt; & Lt; / Storyboard & gt; & Lt; /Page.Resources>

Now they should not have any reason to trigger them automatically, while your code triggers when triggering them, will still do the same thing.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -