protected virtual void UpdateLineFigure(PathFigure figure, GridLine definition, Orientation orientation, double directOffset, double indirectOffset, double size) { var line = (LineSegment)figure.Segments[0]; figure.StartPoint = orientation == Orientation.Horizontal ? new Point(directOffset, indirectOffset) : new Point(indirectOffset, directOffset); line.Point = orientation == Orientation.Horizontal ? new Point(directOffset, indirectOffset + size) : new Point(indirectOffset + size, directOffset); }
protected override void UpdateLineFigure(PathFigure figure, GridLine definition, Orientation orientation, double directOffset, double indirectOffset, double size) { var tickMarkDefinition = (TickMarkDefinition)definition; var tickMarkSize = tickMarkDefinition.Size; base.UpdateLineFigure(figure, definition, orientation, directOffset, MaxTickMarkSize - tickMarkSize, tickMarkSize); }
protected virtual PathFigure CreateLineFigure(GridLine definition, Orientation orientation, double directOffset, double indirectOffset, double size) { var horizontal = orientation.IsHorizontal(); var lineFigure = new PathFigure { StartPoint = new Point(horizontal ? directOffset : indirectOffset, horizontal ? indirectOffset : directOffset) }; lineFigure.Segments.Add(new LineSegment { Point = new Point(horizontal ? directOffset : indirectOffset + size, horizontal ? indirectOffset + size : directOffset) }); return(lineFigure); }
protected override PathFigure CreateLineFigure(GridLine definition, Orientation orientation, double directOffset, double indirectOffset, double size) { var tickMarkDefinition = (TickMarkDefinition)definition; var tickMarkSize = tickMarkDefinition.Size; if (tickMarkDefinition.ShowLabel) { var textDistance = orientation == Orientation.Horizontal ? TextDistance : -TextDistance; var textBlockOffset = directOffset + textDistance - MaxGridStep; var rect = new Rect(new Point(orientation.IsHorizontal() ? textBlockOffset : 0, orientation.IsVertical() ? textBlockOffset : 0), XamlConstants.ZeroSize); if (_isAttached) { AttachTextBlock(rect); } _textBlockRects.Add(rect); } return(base.CreateLineFigure(definition, orientation, directOffset, MaxTickMarkSize - tickMarkSize, tickMarkSize)); }