public RelativePositions(Position position, Position beakPosition, string dirClassName, DirectionalHint submenuDir) { CalloutPosition = position; BeakPosition = beakPosition; DirectionalClassName = dirClassName; SubmenuDirection = submenuDir; }
private double GetMaxHeightFromTargetRectangle(Rectangle targetRect, DirectionalHint targetEdge, double gapSpace, Rectangle bounds) { double maxHeight = 0; var directionalHint = DirectionalDictionary[targetEdge]; var target = CoverTarget ? (RectangleEdge)((int)directionalHint.TargetEdge * -1) : directionalHint.TargetEdge; if (target == RectangleEdge.Top) { maxHeight = GetEdgeValue(targetRect, directionalHint.TargetEdge) - bounds.top - gapSpace; } else if (target == RectangleEdge.Bottom) { maxHeight = bounds.bottom - GetEdgeValue(targetRect, directionalHint.TargetEdge) - gapSpace; } else { maxHeight = bounds.bottom - targetRect.top - gapSpace; } return(maxHeight > 0 ? maxHeight : bounds.height); }