【发布时间】:2016-04-10 19:13:22
【问题描述】:
我正在编写一个适用于 Windows (W10 + WP10) 的通用应用程序,并想启动一个情节提要,然后显示作为绑定的文本已更改。
第一次尝试:
<TextBlock Text="{Binding ASH}">
<TextBox.Triggers>
<EventTrigger RoutedEvent="Binding.TargetUpdated" >
<BeginStoryboard >
<Storyboard>
<ColorAnimation Storyboard.TargetProperty="(Background).(SolidColorBrush.Color)" From="Red" To="Transparent" Duration="0:1:0" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</TextBox.Triggers>
</TextBlock>
第二次尝试:
<TextBlock Text="{Binding ASH}">
<TextBox.Triggers>
<EventTrigger RoutedEvent="TextBlock.DataContextChanged" >
<BeginStoryboard >
<Storyboard>
<ColorAnimation Storyboard.TargetProperty="(Background).(SolidColorBrush.Color)" From="Red" To="Transparent" Duration="0:1:0" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</TextBox.Triggers>
</TextBlock>
谁有想法,如何开始故事板?
谢谢。
【问题讨论】:
-
您是否只需要 XAML 并安装了行为包?您可以使用 ControlStoryboardAction 行为。
标签: xaml triggers textbox storyboard uwp