protected override ScreenCanvas CreateScreenCanvas(Bll.ScreenDocument screen)
        {
            var canvas = new LayoutScreenCanvas(ToolProvider);
            canvas.Screen = screen;

            return canvas;
        }
        protected override ScreenCanvas CreateScreenCanvas(Bll.ScreenDocument screen)
        {
            var canvas = new LayoutScreenCanvas(ToolProvider);

            canvas.Screen = screen;

            return(canvas);
        }
        private void SnapScreenJoin(LayoutScreenCanvas screenCanvas)
        {
            FreezeLayout();

            screenCanvas.Screen.SeverAllJoins();

            foreach (LayoutScreenCanvas neighbor in _screens.Values)
            {
                if (neighbor == screenCanvas)
                {
                    continue;
                }

                var rightDistance = screenCanvas.RightDistanceTo(neighbor);
                var leftDistance  = neighbor.RightDistanceTo(screenCanvas);
                var downDistance  = screenCanvas.DownDistanceTo(neighbor);
                var upDistance    = neighbor.DownDistanceTo(screenCanvas);

                if (rightDistance < 10)
                {
                    screenCanvas.JoinRightwardTo(neighbor);
                }
                else if (leftDistance < 10)
                {
                    neighbor.JoinRightwardTo(screenCanvas);
                }

                if (downDistance < 10)
                {
                    screenCanvas.JoinDownwardTo(neighbor);
                }
                else if (upDistance < 10)
                {
                    neighbor.JoinDownwardTo(screenCanvas);
                }
            }

            UnfreezeLayout();
        }
        private void SnapScreenJoin(LayoutScreenCanvas screenCanvas)
        {
            FreezeLayout();

            screenCanvas.Screen.SeverAllJoins();

            foreach (LayoutScreenCanvas neighbor in _screens.Values)
            {
                if (neighbor == screenCanvas)
                {
                    continue;
                }

                var rightDistance = screenCanvas.RightDistanceTo(neighbor);
                var leftDistance = neighbor.RightDistanceTo(screenCanvas);
                var downDistance = screenCanvas.DownDistanceTo(neighbor);
                var upDistance = neighbor.DownDistanceTo(screenCanvas);

                if (rightDistance < 10)
                {
                    screenCanvas.JoinRightwardTo(neighbor);
                }
                else if (leftDistance < 10)
                {
                    neighbor.JoinRightwardTo(screenCanvas);
                }

                if (downDistance < 10)
                {
                    screenCanvas.JoinDownwardTo(neighbor);
                }
                else if (upDistance < 10)
                {
                    neighbor.JoinDownwardTo(screenCanvas);
                }
            }

            UnfreezeLayout();
        }