How to trigger an Animation when TextBlock’s Text is changed during a DataBinding

简介:

原文:http://michaelscherf.wordpress.com/2009/02/23/how-to-trigger-an-animation-when-textblocks-text-is-changed-during-a-databinding/

 

        <TextBlock x:Name="tbMessage" Text="{Binding Path=StatusBarText, NotifyOnTargetUpdated=True}">
            <TextBlock.Triggers>
                <EventTrigger RoutedEvent="Binding.TargetUpdated">
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetProperty="Opacity" Duration="0:0:0" To="1.0" />
                            <DoubleAnimation Storyboard.TargetProperty="Opacity" Duration="0:0:2" From="1.0" To="0.0" BeginTime="0:0:5" />
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
            </TextBlock.Triggers>

</TextBlock>



本文转自 sun8134 博客园博客,原文链接: http://www.cnblogs.com/sun8134/p/4174197.html ,如需转载请自行联系原作者

相关文章
|
7月前
|
Android开发
Can t process attribute android:fillColor=@color/camera_progress_delete: references to other resou
Can t process attribute android:fillColor=@color/camera_progress_delete: references to other resou
48 1
|
API
DataTables中的column().visible()
在数据表中显示和隐藏列非常方便,尤其是在显示信息密度较大的表时。此方法允许即时更改单个列的可见性,或读取列的可见性状态。
173 0
An InputDecorator, which is typically created by a TextField, cannot have an unbounded width
An InputDecorator, which is typically created by a TextField, cannot have an unbounded width
|
JavaScript
Element UI - el-table-column 属性之 show-overflow-tooltip 爬坑
Element UI - el-table-column 属性之 show-overflow-tooltip 爬坑
2437 0
|
C#
在Style中将EventTrigger与Trigger同时使用
原文:在Style中将EventTrigger与Trigger同时使用 现在在看WPF关于Trigger的有关实例,然后找到一篇不错的文章,特此转载,收藏一下!!   一般情况下,使用Style时,可以对ControlTemplate添加Triggers,既可以添加EventTrigger,又可以Trigger。
1141 0