原文: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>

相关文章:

  • 2021-10-02
  • 2022-03-02
  • 2021-06-16
  • 2022-02-17
  • 2021-05-28
  • 2022-12-23
  • 2021-07-31
  • 2021-11-28
猜你喜欢
  • 2021-07-06
  • 2022-02-16
  • 2021-11-01
  • 2021-08-02
  • 2022-12-23
  • 2021-06-19
相关资源
相似解决方案