G Scott
asked on
Animate Border WPF
So, I added a striped border to a rectangle from the code behind
I want to animate this so it appears to be moving or rotating. I have seen quite a few examples on SO using XAML, but i want to do it purely using code. Can someone help me out with this? Thanks for any input you may have on this; I truly appreciate it.
Dim myBrush As New LinearGradientBrush()
myBrush.GradientStops.Add(New GradientStop(Colors.DeepPink, 0.0))
myBrush.GradientStops.Add(New GradientStop(Colors.DeepPink, 0.5))
myBrush.GradientStops.Add(New GradientStop(Colors.DarkRed, 0.5))
myBrush.GradientStops.Add(New GradientStop(Colors.DarkRed, 1.0))
'myBrush.RelativeTransform = ScaleTransform.ScaleXProperty
Dim scale As New ScaleTransform(0.1, 0.1)
myBrush.RelativeTransform = scale
myBrush.SpreadMethod = GradientSpreadMethod.Repeat
rect0.Fill = New SolidColorBrush(Colors.LightCoral)
theBorder.BorderBrush = myBrush
I want to animate this so it appears to be moving or rotating. I have seen quite a few examples on SO using XAML, but i want to do it purely using code. Can someone help me out with this? Thanks for any input you may have on this; I truly appreciate it.
Can you post the links to the XAML examples you found?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I just collapse and show borders as I need them.