How to trigger a storyboard on property changed
Asked Answered
C

1

9

I would like to have a storyboard started, whenever the value of MyCounterchanges.
With a DataTrigger I only can trigger on a specific value.

<DataTemplate.Triggers>
    <DataTrigger Binding="{Binding Path=MyCounter}" Value="Doesn't matter">
            <BeginStoryboard Storyboard="{StaticResource myStoryboard}"/>
    </DataTrigger>
</DataTemplate.Triggers>
Cothran answered 27/7, 2011 at 10:2 Comment(0)
F
15

You can use an EventTrigger with the TargetUpdated event to trigger the storyboard instead of a DataTrigger. See here for an example.

Floorboard answered 27/7, 2011 at 10:10 Comment(1)
This seems to be unavailable for UWP.Backplate

© 2022 - 2024 — McMap. All rights reserved.