private LineSegmentWithCircles ER(Point p1, Point p2)
        {
            LineSegmentWithCircles myER = new LineSegmentWithCircles();

            myER.Radius          = 10.0;
            myER.From            = p1;
            myER.To              = p2;
            myER.Stroke          = Brushes.Black;
            myER.StrokeThickness = 2;
            return(myER);
        }
        public void drawStaticSolution()
        {
            if (timer != null)
            {
                timer.Stop();
                timer.Dispose();
            }

            if (doc.solved && fsize > 0.0 && withAnimation == false)
            {
                for (int ii = 1; ii <= doc.Goal; ii++)
                {
                    LineSegmentWithCircles mer1 = CreateNumberGroups(ii);
                    this.Children.Add(mer1);
                }
            }
            drawNumbers();
        }
        private void InsertAnimatedRanges(int step)
        {
            // Create a line segment from the to and from points
            if (step > 0 && step <= doc.Goal)
            {
                LineSegmentWithCircles lsc = CreateNumberGroups(step);
                Storyboard             sb  = new Storyboard();

                this.Children.Add(lsc);

                DoubleAnimation myAnimation = new DoubleAnimation();
                int             numblocks   = measureBlockLength(step);

                Duration duration = new Duration(TimeSpan.FromMilliseconds(Velocity * numblocks));
                myAnimation.Duration = duration;

                Storyboard myStoryboard = new Storyboard();

                myStoryboard.Children.Add(myAnimation);
                myStoryboard.Duration = duration;
                Storyboard.SetTarget(myAnimation, lsc);
                myAnimation.From = 0.0;

                if (numblocks <= 1)
                {
                    myAnimation.To = fsize / 2.0;
                    Storyboard.SetTargetProperty(myAnimation, new PropertyPath("(Radius)"));
                }
                else
                {
                    myAnimation.To = 1.0;
                    Storyboard.SetTargetProperty(myAnimation, new PropertyPath("(Progress)"));
                }
                myStoryboard.Begin();
            }
        }