How to trigger a storyboard on property changed

16,899

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

Share:
16,899

Related videos on Youtube

WaltiD
Author by

WaltiD

Software engineer with favorite tags like: wpf, c#, xaml, scrum, ...

Updated on June 04, 2022

Comments

  • WaltiD
    WaltiD almost 2 years

    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>
    
  • Shimmy Weitzhandler
    Shimmy Weitzhandler about 8 years
    This seems to be unavailable for UWP.