コード例 #1
0
            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);
            }
コード例 #2
0
            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);
            }
コード例 #3
0
            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);
            }
コード例 #4
0
            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));
            }