public void RectangleMethod() { DoubleAnimation db = new DoubleAnimation { From = 0, To = 1196, Duration = TimeSpan.FromSeconds(1), EasingFunction = new QuinticEase() }; Rec.BeginAnimation(WidthProperty, db); }