samc
Topic Author
Posts: 26
Joined: 21 Aug 2019, 19:22

StoryboardCompletedTrigger

25 Sep 2020, 21:44

I'm attempting to get StoryboardCompletedTrigger to work. My setup looks something like this:

User control:
	<UserControl.Resources>
		<ResourceDictionary>
			<Storyboard x:Key="CooldownStoryboard">
				<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Darken" From="1"/>
			</Storyboard>
		</ResourceDictionary>
	</UserControl.Resources>

	<i:Interaction.Triggers>
		<ei:StoryboardCompletedTrigger Storyboard="{StaticResource CooldownStoryboard}">
			<ei:PlaySoundAction Source="play_hud_cooldown_complete.wav"/>
		</ei:StoryboardCompletedTrigger>
	</i:Interaction.Triggers>
	
	<Grid x:Name="Root" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2,0,3,0">
		<VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="AbilityStates">
                <VisualStateGroup.Transitions>
                    <VisualTransition From="Ready" GeneratedDuration="0" To="Cooldown" Storyboard="{StaticResource CooldownStoryboard}">
                        <VisualTransition.GeneratedEasingFunction>
                            <CircleEase EasingMode="EaseOut"/>
                        </VisualTransition.GeneratedEasingFunction>
                    </VisualTransition>
// ....	
The storyboard triggers, my states are hit, everything seems fine, except the StoryboardCompletedTrigger never seems to fire. I turned on binding logging and it seems fine (no error about the binding at least). I'm probably just doing something dumb. Any help?

thanks,
sam

Tags:
 
samc
Topic Author
Posts: 26
Joined: 21 Aug 2019, 19:22

Re: StoryboardCompletedTrigger

26 Sep 2020, 00:19

Turns out, I was just doing something dumb. After starting at it enough and playing around, I found out that I was listening for the wrong storyboard :(

oops.

sam
 
User avatar
sfernandez
Site Admin
Posts: 2254
Joined: 22 Dec 2011, 19:20

Re: StoryboardCompletedTrigger

28 Sep 2020, 09:59

Thanks for the update Sam, if there is anything we should improve to help identifying that easier please let us know.

Who is online

Users browsing this forum: No registered users and 1 guest