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)); }
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)) ) )); }