开发者

How to trigger a storyboard on property changed

开发者 https://www.devze.com 2023-03-23 00:14 出处:网络
I would like to have a storyboard started, whenever the value of MyCounterchanges. With a DataTrigger I only can trigger on a specific value.

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.Trig开发者_C百科gers>
    <DataTrigger Binding="{Binding Path=MyCounter}" Value="Doesn't matter">
            <BeginStoryboard Storyboard="{StaticResource myStoryboard}"/>
    </DataTrigger>
</DataTemplate.Triggers>


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

0

精彩评论

暂无评论...
验证码 换一张
取 消