private void DeleteEdge(CanvasEdge canvasEdge)
        {
            List<Node> nodesList = CanvasItems.GetAllNodes();

            foreach (Node node in nodesList)
            {
                node.Edges.Remove(canvasEdge.Edge);
            }

            CanvasItems.Remove(canvasEdge);
        }
        private void CorrectEdgePosition(CanvasRectangle rectStart, CanvasRectangle rectEnd, CanvasEdge canvasEdge, bool isTwoSide = false)
        {
            double x1 = rectStart.CanvasLeft + RectangleSize / 2;
            double y1 = rectStart.CanvasTop + RectangleSize / 2;
            double x2 = rectEnd.CanvasLeft + RectangleSize / 2;
            double y2 = rectEnd.CanvasTop + RectangleSize / 2;

            double angleStart;
            double angleEnd;
            double twoSideAdjustment = 0;                           // When there are edges in both directions, their position on the circle must be additionally adjusted...

            if (isTwoSide)
                twoSideAdjustment = 25;                             // ... by a value of 25/50 degrees (depends on edge direction)

            if (x1 <= x2)
            {
                angleStart = MathHelper.GetLineAngle(x1, y1, x2, y2) - MathHelper.AlfaToRadian(twoSideAdjustment);
                angleEnd = angleStart + MathHelper.AlfaToRadian(180) + MathHelper.AlfaToRadian(twoSideAdjustment * 2);
            }
            else
            {
                angleEnd = MathHelper.GetLineAngle(x1, y1, x2, y2) + MathHelper.AlfaToRadian(twoSideAdjustment);
                angleStart = angleEnd + MathHelper.AlfaToRadian(180) - MathHelper.AlfaToRadian(twoSideAdjustment * 2);
            }

            Point newStartPoint = MathHelper.GetPointOnCircle(x1, y1, angleStart, 15);                   // can't be helped ;(
            Point newEndPoint = MathHelper.GetPointOnCircle(x2, y2, angleEnd, 15);

            canvasEdge.X1 = newStartPoint.X;
            canvasEdge.Y1 = newStartPoint.Y;
            canvasEdge.X2 = newEndPoint.X;
            canvasEdge.Y2 = newEndPoint.Y;
        }