I want to be able to Fade In a Border in Code Behind (C#) when the user hovers over a Rectangle in my application.
I've seen a few examples of creating animations in Code behind but cannot get them to work for this instance.
As you can see, I have a MouseEnter event that at the moment, created a border around the object but I want this to Fade In (and out when I have a MouseLeave event)
Can you please help to understand what I need?
private void ImageRect_MouseEnter(object sender, MouseEventArgs e) { SolidColorBrush blueBrush = new SolidColorBrush(); blueBrush.Color = SystemColors.HighlightColor; ImageRect.StrokeThickness = 3; ImageRect.Stroke = blueBrush; }
Thanks very much
Shaun