Esempio n. 1
0
        public override Geometry GetPreviewPath(OverlayWindow overlayWindow, LayoutFloatingWindow floatingWindowModel)
        {
            switch (Type)
            {
            case DropTargetType.DocumentPaneGroupDockInside:

                #region DropTargetType.DocumentPaneGroupDockInside

            {
                var targetScreenRect = TargetElement.GetScreenArea();
                targetScreenRect.Offset(-overlayWindow.Left, -overlayWindow.Top);

                return(new RectangleGeometry(targetScreenRect));
            }

                #endregion
            }

            return(null);
        }
        public override Geometry GetPreviewPath(OverlayWindow overlayWindow, LayoutFloatingWindow floatingWindowModel)
        {
            switch (Type)
            {
            case DropTargetType.DocumentPaneDockInside:
            {
                var targetScreenRect = TargetElement.GetScreenArea();
                targetScreenRect.Offset(-overlayWindow.Left, -overlayWindow.Top);

                if (_tabIndex == -1)
                {
                    return(new RectangleGeometry(targetScreenRect));
                }

                var translatedDetectionRect = new Rect(DetectionRects[0].TopLeft, DetectionRects[0].BottomRight);
                translatedDetectionRect.Offset(-overlayWindow.Left, -overlayWindow.Top);

                var pathFigure = new PathFigure();
                pathFigure.StartPoint = targetScreenRect.BottomRight;
                pathFigure.Segments.Add(new LineSegment
                    {
                        Point = new Point(targetScreenRect.Right, translatedDetectionRect.Bottom)
                    });
                pathFigure.Segments.Add(new LineSegment {
                        Point = translatedDetectionRect.BottomRight
                    });
                pathFigure.Segments.Add(new LineSegment {
                        Point = translatedDetectionRect.TopRight
                    });
                pathFigure.Segments.Add(new LineSegment {
                        Point = translatedDetectionRect.TopLeft
                    });
                pathFigure.Segments.Add(new LineSegment {
                        Point = translatedDetectionRect.BottomLeft
                    });
                pathFigure.Segments.Add(new LineSegment
                    {
                        Point = new Point(targetScreenRect.Left, translatedDetectionRect.Bottom)
                    });
                pathFigure.Segments.Add(new LineSegment {
                        Point = targetScreenRect.BottomLeft
                    });
                pathFigure.IsClosed = true;
                pathFigure.IsFilled = true;
                pathFigure.Freeze();
                return(new PathGeometry(new[] { pathFigure }));
            }

            case DropTargetType.DocumentPaneDockBottom:
            {
                var targetScreenRect = TargetElement.GetScreenArea();
                targetScreenRect.Offset(-overlayWindow.Left, -overlayWindow.Top);
                targetScreenRect.Offset(0.0, targetScreenRect.Height / 2.0);
                targetScreenRect.Height /= 2.0;
                return(new RectangleGeometry(targetScreenRect));
            }

            case DropTargetType.DocumentPaneDockTop:
            {
                var targetScreenRect = TargetElement.GetScreenArea();
                targetScreenRect.Offset(-overlayWindow.Left, -overlayWindow.Top);
                targetScreenRect.Height /= 2.0;
                return(new RectangleGeometry(targetScreenRect));
            }

            case DropTargetType.DocumentPaneDockLeft:
            {
                var targetScreenRect = TargetElement.GetScreenArea();
                targetScreenRect.Offset(-overlayWindow.Left, -overlayWindow.Top);
                targetScreenRect.Width /= 2.0;
                return(new RectangleGeometry(targetScreenRect));
            }

            case DropTargetType.DocumentPaneDockRight:
            {
                var targetScreenRect = TargetElement.GetScreenArea();
                targetScreenRect.Offset(-overlayWindow.Left, -overlayWindow.Top);
                targetScreenRect.Offset(targetScreenRect.Width / 2.0, 0.0);
                targetScreenRect.Width /= 2.0;
                return(new RectangleGeometry(targetScreenRect));
            }
            }

            return(null);
        }
Esempio n. 3
0
 public abstract Geometry GetPreviewPath(OverlayWindow overlayWindow, LayoutFloatingWindow floatingWindow);