2

We have a TextBlock in a Windows Store (8.1) app e.g.

<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.

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.

How would this be done in Windows Store XAML?

Pat Long - Munkii Yebee
  • 3,592
  • 2
  • 34
  • 68
  • you can have a look at http://stackoverflow.com/questions/4946912/how-to-animate-the-background-of-a-textblock-when-changing-the-value-of-the-boun – Justin CI Dec 16 '15 at 11:38

1 Answers1

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.

ZeeMoussa
  • 173
  • 10