Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to trigger a storyboard on property changed

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>
like image 483
WaltiD Avatar asked Jul 27 '11 10:07

WaltiD


1 Answers

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

like image 127
IanR Avatar answered Oct 29 '22 16:10

IanR