Firing multiple storyboards noesis:DataEventTrigger
Am I using `noesis:DataEventTrigger` incorrectly?
I've created a simple storyboard that draws a line using `TrimEnd`.
I populate ItemsControl with a list from an Unreal property, each object is defined as the following:
When I call this `OnDraw` in Blueprint for any of the instances in the array, it stops the Storyboard for all other instances. I.e. if I were to call `OnDraw` on 100 instances of `UGameMapLine`, the animation would only play on the last instance. If I were to wait for the whole length of the animation in between each call, I would be able to play all of the animations sequentially, but I can never play two or more at the same time.
If I substitute this with the following, every instance plays the animation simultaneously as you'd expect.
More info if additional context is needed:
The list of `Lines` is declared on a View and used to populate an items control.
The template is defined like this:
The rest of the `Grid` contains my layout which is probably not important.
I've created a simple storyboard that draws a line using `TrimEnd`.
I populate ItemsControl with a list from an Unreal property, each object is defined as the following:
Code: Select all
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnDrawLineDelegate);
class UGameMapLine : public UObject
{
...
UPROPERTY(BlueprintAssignable, BlueprintCallable)
FOnDrawLineDelegate OnDraw;
...
Code: Select all
<b:Interaction.Triggers>
<noesis:DataEventTrigger Source="{Binding}" EventName="OnDraw">
<b:ControlStoryboardAction Storyboard="{StaticResource Anim.Draw}"/>
</noesis:DataEventTrigger>
</b:Interaction.Triggers>
Code: Select all
<ControlTemplate.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard Storyboard="{StaticResource Anim.Draw}"/>
</EventTrigger>
</ControlTemplate.Triggers>
More info if additional context is needed:
The list of `Lines` is declared on a View and used to populate an items control.
Code: Select all
<ItemsControl ItemsSource="{Binding Lines}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Canvas />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<ContentControl Content="{Binding}" Template="{StaticResource Template.Route}" Style="{StaticResource Style.Route}">
<!--<b:Interaction.Triggers>
<noesis:DataEventTrigger Source="{Binding}" EventName="OnDraw">
<b:ControlStoryboardAction Storyboard="{StaticResource Anim.Draw}"/>
</noesis:DataEventTrigger>
</b:Interaction.Triggers>-->
</ContentControl>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
Code: Select all
ControlTemplate x:Key="Template.Route" TargetType="{x:Type ContentControl}">
<ControlTemplate.Resources>
<Storyboard x:Key="Anim.Draw">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(noesis:Path.TrimEnd)" Storyboard.TargetName="Path0">
<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
<SplineDoubleKeyFrame KeySpline="0.586,0 0.418,1" KeyTime="0:0:0.5" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</ControlTemplate.Resources>
<ControlTemplate.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard Storyboard="{StaticResource Anim.Draw}"/>
</EventTrigger>
</ControlTemplate.Triggers>
<Grid x:Name="Root" DataContext="{Binding}">
<b:Interaction.Triggers>
<noesis:DataEventTrigger Source="{Binding}" EventName="OnDraw">
<b:ControlStoryboardAction Storyboard="{StaticResource Anim.Draw}"/>
</noesis:DataEventTrigger>
</b:Interaction.Triggers>
...
-
-
sfernandez
Site Admin
- Posts: 3363
- Joined:
Re: Firing multiple storyboards noesis:DataEventTrigger
Hi, nothing wrong on your side. It seems there is a bug in the ControlStoryboardAction when used inside templates and references a Storyboard from the template or outside of it. Could you please report it in our bugtracker?
In the meantime it should work if you define the Storyboard inside the visual tree of the template, something like this:
In the meantime it should work if you define the Storyboard inside the visual tree of the template, something like this:
Code: Select all
<ControlTemplate x:Key="Template.Route" TargetType="{x:Type ContentControl}">
<Grid x:Name="Root">
<Grid.Resources>
<Storyboard x:Key="Anim.Draw">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(noesis:Path.TrimEnd)" Storyboard.TargetName="Path0">
<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
<SplineDoubleKeyFrame KeySpline="0.586,0 0.418,1" KeyTime="0:0:0.5" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</Grid.Resources>
<b:Interaction.Triggers>
<b:EventTrigger EventName="Loaded">
<b:ControlStoryboardAction Storyboard="{StaticResource Anim.Draw}"/>
</b:EventTrigger>
<noesis:DataEventTrigger Source="{Binding}" EventName="OnDraw">
<b:ControlStoryboardAction Storyboard="{StaticResource Anim.Draw}"/>
</noesis:DataEventTrigger>
</b:Interaction.Triggers>
...
</Grid>
</ControlTemplate>Who is online
Users browsing this forum: No registered users and 4 guests