我为 SpotLight 对象创建了 ColorAnimation,但它似乎不起作用。我究竟做错了什么?
ColorAnimation mouseEnterColorAnimation = new ColorAnimation();
mouseEnterColorAnimation.To = Colors.Red;
mouseEnterColorAnimation.Duration = TimeSpan.FromSeconds(5);
Storyboard.SetTargetName(mouseEnterColorAnimation, "MyAnimatedBrush");
Storyboard.SetTargetProperty(mouseEnterColorAnimation, new PropertyPath(SpotLightAuditorium.Color));
Storyboard storyboard = new Storyboard();
storyboard.RepeatBehavior = RepeatBehavior.Forever;
storyboard.Children.Add(mouseEnterColorAnimation);
storyboard.Begin(this);