/// <summary>
        /// Moves a single GridSegment in a direction by a distance specified in pixels
        /// </summary>
        /// <param name="direction">Direction in which to move</param>
        /// <param name="distance">Integer number of pixels to move by</param>
        /// <param name="element">GridSegment to move</param>
        private void MoveElement(Directions direction, int distance, GridSegment element)
        {
            double left     = Canvas.GetLeft(element);
            double top      = Canvas.GetTop(element);
            bool   overEdge = false;

            switch (direction)
            {
            case Directions.Left:
                left -= distance;
                if (left <= -elementWidth)
                {
                    left      += (currentSegmentNumberHorizontal + 1) * elementWidth;
                    element.Y += (currentSegmentNumberHorizontal + 1);
                    overEdge   = true;
                }
                break;

            case Directions.Right:
                left += distance;
                if (left > currentSegmentNumberHorizontal * elementWidth)                                              //Necessary to ensure that the 'Extra' segments are always to the right and don't overlap with the 'first' segment
                {
                    left      -= (currentSegmentNumberHorizontal + 1) * elementWidth;
                    element.Y -= (currentSegmentNumberHorizontal + 1);
                    overEdge   = true;
                }
                break;

            case Directions.Up:
                top -= distance;
                if (top <= -elementHeight)
                {
                    top       += (currentSegmentNumberVertical + 1) * elementHeight;
                    element.X += (currentSegmentNumberVertical + 1);
                    overEdge   = true;
                }
                break;

            case Directions.Down:
                top += distance;
                if (top > currentSegmentNumberVertical * elementHeight)                                              //Necessary to ensure that the 'Extra' segments are always to the bottom and don't overlap with the 'first' segment
                {
                    top       -= (currentSegmentNumberVertical + 1) * elementHeight;
                    element.X -= (currentSegmentNumberVertical + 1);
                    overEdge   = true;
                }
                break;
            }
            if (overEdge)
            {
                element.RefreshCells();
            }

            Canvas.SetLeft(element, left);
            Canvas.SetTop(element, top);
        }
        /// <summary>
        /// Adds Segments within a range specified and at a displacement specified
        /// </summary>
        /// <param name="horizontalStartNumber">Beginning point in horizontal range</param>
        /// <param name="verticalStartNumber">Beginning point in vertical range</param>
        /// <param name="horizontalEndNumber">end point in horizontal range</param>
        /// <param name="verticalEndNumber">end point in vertical range</param>
        /// <param name="x">Segment X value from which to begin</param>
        /// <param name="y">Segment Y value from which to begin</param>
        /// <param name="leftMargin">left displacement</param>
        /// <param name="topMargin">top displacement</param>
        private void AddSegments(int horizontalStartNumber, int verticalStartNumber, int horizontalEndNumber, int verticalEndNumber, int y, int x, double leftMargin, double topMargin)
        {
            for (int i = horizontalStartNumber; i <= horizontalEndNumber; i++)
            {
                for (int j = verticalStartNumber; j <= verticalEndNumber; j++)
                {
                    GridSegment _segmentToAdd = new GridSegment();
                    _segmentToAdd.X = (x + j);
                    _segmentToAdd.Y = (y + i);

                    canvasGrid.Children.Add(_segmentToAdd);

                    double left = elementWidth * i + leftMargin;
                    double top  = elementHeight * j + topMargin;

                    Canvas.SetLeft(_segmentToAdd, left);
                    Canvas.SetTop(_segmentToAdd, top);

                    _segmentToAdd.RefreshCells();
                }
            }
        }