Как мне анимировать непрозрачность эффекта дропшоу в коде. Я динамически создаю стековые панели в моем пользовательском интерфейсе, которые содержат изображение и текстовый блок. Я применил эффект капли к изображению, который я хотел бы, чтобы оживить непрозрачность. Вот что у меня есть:
Image img = ch.ChannelLogo; //Create the image for the button
img.Height = channelStackPnl.Height * .66;
DropShadowEffect dSE = new DropShadowEffect();
dSE.Color = Colors.White;
dSE.Direction = 25;
dSE.ShadowDepth = 10;
dSE.Opacity = .40;
img.Effect = dSE;
DoubleAnimation animateOpacity = new DoubleAnimation();
animateOpacity.From = 0;
animateOpacity.To = 1;
animateOpacity.AutoReverse = true;
animateOpacity.RepeatBehavior = RepeatBehavior.Forever;
animateOpacity.Duration = new Duration(new TimeSpan(0, 0, 0, 0, 400));
//Here's where I am stuck. How do I specifically target the opacity of the effect propery?
img.BeginAnimationimg.BeginAnimation(DropShadowEffect.OpacityProperty,animateOpacity);