Class LineBackgroundRenderer
Renderer for changing the background of a ICSharpCode.AvalonEdit.Rendering.TextView.
public class LineBackgroundRenderer : IBackgroundRenderer
- Inheritance
-
LineBackgroundRenderer
- Implements
-
IBackgroundRenderer
- Inherited Members
Examples
_lineBackgroundRenderer = new LineBackgroundRenderer(this, Brushes.Green);
_view.TextEditor.TextArea.TextView.BackgroundRenderers.Add(_lineBackgroundRenderer);
private static void UpdateLineBackgroundRenderer(DependencyObject sender, DependencyPropertyChangedEventArgs eventArgs)
{
// PropertyChangedCallback of the depending DependencyProperty
var codeEditor = sender as CodeEditor;
codeEditor._executingLineBackgroundRenderer.Line = codeEditor.ExecutingLine;
codeEditor._calledLineBackgroundRenderer.Line = codeEditor.CalledLine;
codeEditor.TextArea.TextView.InvalidateLayer(KnownLayer.Selection);
}
Constructors
LineBackgroundRenderer(TextEditor, SolidColorBrush)
Initializes a new instance of the LineBackgroundRenderer class.
public LineBackgroundRenderer(TextEditor editor, SolidColorBrush color)
Parameters
editor
TextEditorText editor.
color
SolidColorBrushColor for the line.
Properties
Layer
Gets the layer on which this background renderer should draw.
public KnownLayer Layer { get; }
Property Value
- KnownLayer
Line
Gets or sets the colorized line.
public int Line { get; set; }
Property Value
Methods
Draw(TextView, DrawingContext)
Causes the background renderer to draw.
public void Draw(TextView textView, DrawingContext drawingContext)
Parameters
textView
TextViewView with the text.
drawingContext
DrawingContextContext for drawing.