tags:

views:

267

answers:

1

I have the following Data Trigger set-up on a Control Template

<DataTrigger Binding="{Binding Path=IsDragged}"
             Value="True">
    <DataTrigger.EnterActions>
        <BeginStoryboard Storyboard="{StaticResource Active}" />
    </DataTrigger.EnterActions>
    <DataTrigger.ExitActions>
        <BeginStoryboard Storyboard="{StaticResource Unactive}" />
    </DataTrigger.ExitActions>
</DataTrigger>

Generally it will fire at least once (not always) and at some point will cease. Some additional interesting notes:

  • The same property is set-up in a MultiDataTrigger, this trigger will always fire
  • The same storyboards are referenced in another trigger, they continue to run after this trigger fails

Edit: The MultiDataTriggers is set-up as follows:

<MultiDataTrigger>
    <MultiDataTrigger.Conditions>
        <Condition Binding="{Binding Path=IsActive}"
                   Value="True" />
        <Condition Binding="{Binding Path=IsDragged}"
                   Value="False" />
        <Condition Binding="{Binding Path=IsInCart}"
                   Value="False" />
    </MultiDataTrigger.Conditions>
    <MultiDataTrigger.EnterActions>
        <BeginStoryboard x:Name="ShowTag_BeginStoryboard"
                         Storyboard="{StaticResource ShowTag}" />
    </MultiDataTrigger.EnterActions>
    <MultiDataTrigger.ExitActions>
        <BeginStoryboard x:Name="HideTag_BeginStoryboard"
                         Storyboard="{StaticResource HideTag}" />
    </MultiDataTrigger.ExitActions>
</MultiDataTrigger>
+1  A: 

Just an educated guess, but I've run into something like this before and it turned out that I needed to stop each storyboard before I started another one, because they were conflicting with each other.

Try adding two StopStoryboard actions to your DataTrigger, one to stop the Active storyboard and the other to stop the Unactive storyboard.

Charlie
That looks to have been the issue, working consistently now.
Richard C. McGuire