Is it possible with an animation to change the Ellipse.Fill from a LinearGradientBrush to a SolidColorBrush or change the gradientStops within the LinearGradientBrush?
Asked
Active
Viewed 2,030 times
2 Answers
3
Maybe you should use two ellipses and dynamically change their opacity.

Zach Johnson
- 23,678
- 6
- 69
- 86

Y.Yanavichus
- 2,387
- 1
- 21
- 34
-
Unfortunate how it's going to bloat the markup, but +1 for a nice lateral solution. – Chris Hagan Oct 30 '10 at 10:13
3
You can animate the individual gradient stops of a gradient brush (and by setting them to the same color, you'd get a 'solid' color) This is an example of animating the gradient set to the Panel.Background of some target:
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).
(GradientBrush.GradientStops)[0].(GradientStop.Color)"
Storyboard.TargetName="sometarget">
<EasingColorKeyFrame KeyTime="0"
Value="Blue" />
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).
(GradientBrush.GradientStops)[1].(GradientStop.Color)"
Storyboard.TargetName="sometarget">
<EasingColorKeyFrame KeyTime="0"
Value="Green" />
</ColorAnimationUsingKeyFrames>
</Storyboard>

aL3891
- 6,205
- 3
- 33
- 37