Example #1
0
        bool AcceptableUndockingStartPoint()
        {
#if alldbg || dbg
            DesktopPanelTool.Lib.Debug.WriteLine($"acceptable start point: has parent={WPFHelper.HasParent<WidgetControl>(Mouse.DirectlyOver as DependencyObject)}");
#endif
            return(!WPFHelper.HasParent <WidgetControl>(Mouse.DirectlyOver as DependencyObject));
        }
Example #2
0
        bool AcceptMousePosition(Point p)
        {
            var m = AssociatedObject.Margin;

            return(IsMovable &&
                   ((
                        p.X > NotMovableEdgeSize + m.Left &&
                        p.X < AssociatedObject.Width - NotMovableEdgeSize - m.Right &&
                        p.Y > NotMovableEdgeSize + m.Top &&
                        p.Y < AssociatedObject.Height - NotMovableEdgeSize - m.Bottom
                        ) &&
                    (TypeControlUnderMouseAvoidingMove == null ||
                     (Mouse.DirectlyOver is DependencyObject o &&
                      !WPFHelper.HasParent(TypeControlUnderMouseAvoidingMove, o))
                    )
                   ));
        }