0
У меня есть этот код, но я не могу использовать, что, поскольку это бросает исключение, когда я называю sb.Begin():Silverlight «Цель анимации не указана».
цель анимации не указано.
public void TableCardAnimation(UserControl cardControl, double Height, double Width)
{
Storyboard sb = new Storyboard();
DoubleAnimation animHeight = new DoubleAnimation();
animHeight.Duration = new Duration(new TimeSpan(0, 0, 2));
animHeight.From = cardControl.Height;
animHeight.To = Height;
sb.Children.Add(animHeight);
Storyboard.SetTarget(animHeight, cardControl);
Storyboard.SetTargetProperty(animHeight, new PropertyPath("(Height)"));
DoubleAnimation animWidth = new DoubleAnimation();
animWidth.Duration = new Duration(new TimeSpan(0, 0, 2));
animWidth.From = cardControl.Width;
animWidth.To = Width;
sb.Children.Add(animWidth);
Storyboard.SetTarget(animWidth, cardControl);
Storyboard.SetTargetProperty(animHeight, new PropertyPath("(Width)"));
sb.Begin();
}
Где я ошибаюсь? :(