//draw a circle in stackPanel private void DrawCircle(Storyboard sb, Canvas cv) { Ellipse el = new Ellipse(); el.Margin = new Thickness(13, 8, 0, 0); el.Width = 0; el.Height = 0; el.Stroke = Brushes.Blue; el.StrokeThickness = 10; cv.Children.Add(el); DoubleAnimation widthAnimation = new DoubleAnimation(el.Width, 90, new Duration(new TimeSpan(0, 0, 1))); DoubleAnimation heightAnimation = new DoubleAnimation(el.Height, 80, new Duration(new TimeSpan(0, 0, 1))); Storyboard.SetTargetProperty(widthAnimation, new PropertyPath(Ellipse.WidthProperty)); Storyboard.SetTargetProperty(heightAnimation, new PropertyPath(Ellipse.HeightProperty)); sb.Children.Add(widthAnimation); sb.Children.Add(heightAnimation); el.BeginStoryboard(sb); }