0

This issue doesn't seem to have any cause. There is no Storyboard.Begin() called anywhere in code (searched with a 'Find all' in current project) and no triggers as far as can be seen.

Using Storyboard.Stop() in Page_Loaded event for every single Storyboard present fixes this issue but it seems more like a hack than a solution. What causes this behaviour and how can it be fixed?

The similar issue from here has a solution but it does not apply in this case: not using Blend

My code is as follows:

 <Page.Resources> [...] <BeginStoryboard x:Name="StartButtonTranslateAndShrinkStoryboard"> <Storyboard RepeatBehavior="0x"> <DoubleAnimation Storyboard.TargetName="StartButtonTransform" Storyboard.TargetProperty="(CompositeTransform.TranslateX)" From="0" To="140" Duration="0:0:1"/> <DoubleAnimation Storyboard.TargetName="StartButtonTransform" Storyboard.TargetProperty="(CompositeTransform.TranslateY)" From="0" To="300" Duration="0:0:1"/> <DoubleAnimation Storyboard.TargetName="StartButtonTransform" Storyboard.TargetProperty="(CompositeTransform.ScaleX)" From="3" To="1" Duration="0:0:1"/> <DoubleAnimation Storyboard.TargetName="StartButtonTransform" Storyboard.TargetProperty="(CompositeTransform.ScaleY)" From="3" To="1" Duration="0:0:1"/> </Storyboard> </BeginStoryboard> [...] </Page.Resources> 

1 Answer 1

1

Don't put it in the <BeginStoryboard> tags, that is a trigger that starts the storyboard. You can assign the name of the storyboard (in your case StartButtonTranslateAndShrinkStoryboard) to the storyboard itself instead of the trigger and it should work.

<Page.Resources> [...] <Storyboard RepeatBehavior="0x" x:Name="StartButtonTranslateAndShrinkStoryboard"> <DoubleAnimation Storyboard.TargetName="StartButtonTransform" Storyboard.TargetProperty="(CompositeTransform.TranslateX)" From="0" To="140" Duration="0:0:1"/> <DoubleAnimation Storyboard.TargetName="StartButtonTransform" Storyboard.TargetProperty="(CompositeTransform.TranslateY)" From="0" To="300" Duration="0:0:1"/> <DoubleAnimation Storyboard.TargetName="StartButtonTransform" Storyboard.TargetProperty="(CompositeTransform.ScaleX)" From="3" To="1" Duration="0:0:1"/> <DoubleAnimation Storyboard.TargetName="StartButtonTransform" Storyboard.TargetProperty="(CompositeTransform.ScaleY)" From="3" To="1" Duration="0:0:1"/> </Storyboard> [...] </Page.Resources> 

From MSDN:

A trigger action that begins a Storyboard. Not commonly used.

Sign up to request clarification or add additional context in comments.

1 Comment

While this was the solution and fixed my issue I still wonder why <BeginStoryboard> triggered if it was in <Page.Resources>

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.