I have a WPF window with a label control used for messages to the user. After a few seconds, I want the message to fade away. I have created a DispatcherTimer
Its due to the "fill behavior" of the animation. It's effectively holding on to the value after the animation and not letting go, preventing it from being updated.
Its an easy fix, change the fill behavior to stop and add an event handler to change the opacity value to 0 after the animation (otherwise it will go back to 1)
animation.FillBehavior = FillBehavior.Stop;
animation.Completed += delegate
{
lblTest.Opacity = 0;
};
I have tested this with your code and it worked.
Ben