Apologies for this trivial question, I’m new to WPF and keep finding blogs that almost describe what I want…
I have a Label that is bound to a property and updating nicely on screen, and now I’d like a small animation that flashes the background colour of the label whenever the value is updated. Ideally I’d like a pure xaml solution
I’ve looked at DataTriggers but they seem to require an equality condition to hold, and EventTriggers seem to not be possible to attached to any events to do with the display of data
thanks
Oskar
please check if code below would work for you. Any change for Content property of the label is animated. It’s done using triggers and value converter class which does the small trick converting content value to either “True” or “False” and triggers are set up to react on those 2 values. Cnverter is attached to the Tag property of the label which is bent to the Name property of data context. Also I’ve added some animation to mouse enter and leave events which are pretty straightforward and done only using RouterEvents in xaml.
converter:
data context initialization:
xaml:
hope this helps, regards