We have a TextBlock in a Windows Store (8.1) app e.g.
我们在Windows Store(8.1)应用程序中有一个TextBlock。
<TextBlock Style="{StaticResource NameItemCellStyle}"
Text="{Binding Name}"/>
When the name value is updated I would like to temporarily change the TextColor and Background Colour of the TextBlock for 5 seconds.
当名称值被更新时,我想暂时更改文本块的TextColor和背景颜色5秒。
It looks like some that could be solved with a Behaviour but I'm not sure. If it was Javascript I would add a CSS class "redBlock" and then kick of a timer to remove that CSS class in 5 minutes.
看起来有些问题可以通过行为来解决,但我不确定。如果是Javascript,我会添加一个CSS类“redBlock”,然后用计时器在5分钟内删除CSS类。
How would this be done in Windows Store XAML?
如何在Windows Store XAML中实现这一点?
1 个解决方案
#1
0
You can add a visual state for the textblock once the text added you can trigger the visual state manager to go to the text box visual state and you can control it using time line to be 5 sec.
你可以为textblock添加一个可视状态一旦添加了文本你可以触发visual state manager到文本框的可视状态你可以使用时间线控制它到5秒。
#1
0
You can add a visual state for the textblock once the text added you can trigger the visual state manager to go to the text box visual state and you can control it using time line to be 5 sec.
你可以为textblock添加一个可视状态一旦添加了文本你可以触发visual state manager到文本框的可视状态你可以使用时间线控制它到5秒。