View Issue Details

IDProjectCategoryView StatusLast Update
0004470NoesisGUIC++ SDKpublic2025-11-05 11:04
ReporterFrancoisRecisio Assigned Tosfernandez  
PrioritynormalSeverityfeature 
Status resolvedResolutionno change required 
Product Version3.2.10 
Summary0004470: Add target in BeginStoryboard
Description

Hello! I just had a little idea, maybe it's not a good idea, but I wanted to share it with you.

I think it would be useful to have a "Target" parameter in BeginStoryboard.
The same one that is present in the Begin method of Storyboard :
void Begin(FrameworkElement* target);

This would allow us to have a Storyboard defined in a XAML file and be able to Begin it on multiple targets without having to specify the Target explicitly in the Storyboard.
Thanks!

PlatformAny

Activities

FrancoisRecisio

FrancoisRecisio

2025-10-30 16:32

reporter   ~0011313

something like

    <ViewElement.Triggers>
        <EventTrigger RoutedEvent="ViewElement.Bind">
            <EventTrigger.Actions>
                <BeginStoryboard Storyboard="{StaticResource ViewInitAnimation}" TargetName="MyTarget" />
Demond

Demond

2025-10-30 18:06

reporter   ~0011314

Yes! That would be great. Sometimes I need to play the same animation on multiple target objects that have similar animated properties, but I'm forced to simply duplicate the Storyboard or the same keyframes in a single Storyboard and only change the target. It would also be useful to have this on ControlStoryboardAction.

sfernandez

sfernandez

2025-11-04 13:17

manager   ~0011350

BeginStoryboard starts the Storyboard using the element where it is defined as target, so things like this already work:

<Grid
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Background="White">
  <Grid.Resources>
    <Storyboard x:Key="hoverOn">
      <ColorAnimation To="YellowGreen" Storyboard.TargetProperty="Fill.Color"/>
    </Storyboard>
    <Storyboard x:Key="hoverOff">
      <ColorAnimation To="Orange" Storyboard.TargetProperty="Fill.Color"/>
    </Storyboard>
  </Grid.Resources>
  <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
    <Rectangle Width="300" Height="100" Fill="Orange" Margin="0,10">
      <Rectangle.Triggers>
        <EventTrigger RoutedEvent="UIElement.MouseEnter">
          <BeginStoryboard Storyboard="{StaticResource hoverOn}"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="UIElement.MouseLeave">
          <BeginStoryboard Storyboard="{StaticResource hoverOff}"/>
        </EventTrigger>
      </Rectangle.Triggers>
    </Rectangle>
    <Ellipse Width="300" Height="100" Fill="Orange" Margin="0,10">
      <Ellipse.Triggers>
        <EventTrigger RoutedEvent="UIElement.MouseEnter">
          <BeginStoryboard Storyboard="{StaticResource hoverOn}"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="UIElement.MouseLeave">
          <BeginStoryboard Storyboard="{StaticResource hoverOff}"/>
        </EventTrigger>
      </Ellipse.Triggers>
    </Ellipse>
  </StackPanel>
</Grid>

Isn't this enough?

FrancoisRecisio

FrancoisRecisio

2025-11-05 10:20

reporter   ~0011357

I hadn't realised I could use it like that (I was already doing it in some places but without thinking about it). I think that might be enough, sorry and thanks!

sfernandez

sfernandez

2025-11-05 11:04

manager   ~0011358

Great, closing this.

Issue History

Date Modified Username Field Change
2025-10-30 16:30 FrancoisRecisio New Issue
2025-10-30 16:32 FrancoisRecisio Note Added: 0011313
2025-10-30 18:06 Demond Note Added: 0011314
2025-11-04 13:04 jsantos Assigned To => sfernandez
2025-11-04 13:04 jsantos Status new => assigned
2025-11-04 13:17 sfernandez Status assigned => feedback
2025-11-04 13:17 sfernandez Note Added: 0011350
2025-11-05 10:20 FrancoisRecisio Note Added: 0011357
2025-11-05 10:20 FrancoisRecisio Status feedback => assigned
2025-11-05 11:04 sfernandez Status assigned => resolved
2025-11-05 11:04 sfernandez Resolution open => no change required
2025-11-05 11:04 sfernandez Note Added: 0011358