DoubleAnimation doubleAnimation = new DoubleAnimation() { From = 0, To = 20, AutoReverse = true, Duration = new Duration(TimeSpan.FromSeconds(0.5)) }; //阴影效果 DropShadowEffect effect = new DropShadowEffect() { Direction = 0, ShadowDepth = 0, Color = Colors.Gray }; //为textblock1添加阴影效果 textBlock1.Effect = effect; //为阴影效果的 BlurRadius属性执行动画 effect.BeginAnimation(DropShadowEffect.BlurRadiusProperty, doubleAnimation);