Animate WPF text when binding updates, how?

I want to create a fade animation in a text element when snapping to these element updates. In other words, the effect is that as the text is added to the text field, and you see the fading effect when the text is updated and then disappears. I do not know how to achieve this. I saw something similar using EventTrigger in RoutedEvent , for example FrameworkElement.Loaded , but how to determine when the binding is updated?

Thanks.

+4
source share
1 answer

You can set the properties in your binding, which will lead to the dismissal of events. Two properties are available:

  • NotifyOnSourceUpdated : Raise the SourceUpdated event when a value is passed from the binding target to the binding source.
  • NotifyOnTargetUpdated . Raise the TargetUpdated event when a value is passed from the binding source to the binding target.

From the description of your setting, it sounds like you want to use NotifyOnTargetUpdated. Set this to true in the binding, and then whenever the target is updated, the Binding.TargetUpdated event will fire . You can then listen to this event in EventTrigger and fade your text.

+8
source

All Articles