protected override void OnRender(System.Windows.Media.DrawingContext drawingContext) { drawingContext.DrawRectangle(new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(0, 255, 0, 0)), null, new Rect(RenderSize)); if (this.TextView == null || this.TextView.VisualLinesValid == false) { return; } foreach (VisualLine l in this.TextView.VisualLines) { if (_break.Contains(l.FirstDocumentLine.LineNumber)) { Point lt = new Point(1, l.VisualTop - this.TextView.VerticalOffset + 1); Point rb = new Point(lt.X + this.RenderSize.Width - 4, lt.Y + l.Height - 2); drawingContext.DrawRoundedRectangle(new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(255, 0, 0)), null, new Rect(lt, rb), (rb.X - lt.X) / 2, (rb.Y - lt.Y) / 2); } } //base.OnRender(drawingContext); }