//动画效果 DoubleAnimation doubleAnimation = new DoubleAnimation(0,200, new Duration(TimeSpan.FromSeconds(1))); rectangle2.BeginAnimation(Rectangle.WidthProperty, doubleAnimation);