How to trigger an Animation when TextBlock’s Text is changed during a DataBinding_.NET_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > .NET > How to trigger an Animation when TextBlock’s Text is changed during a DataBinding

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

 2014/12/19 17:31:55  sun8134  程序员俱乐部  我要评论(0)
  • 摘要:原文:http://michaelscherf.wordpress.com/2009/02/23/how-to-trigger-an-animation-when-textblocks-text-is-changed-during-a-databinding/<TextBlockx:Name="tbMessage"Text="{BindingPath=StatusBarText,NotifyOnTargetUpdated=True}"><TextBlock
  • 标签:

原文: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>
上一篇: ios开发常用宏 下一篇: 没有下一篇了!
  • 相关文章
发表评论
用户名: 匿名