This topic explains the current line highlighting feature.
The following topics are prerequisites to understanding this topic:
This topic contains the following sections:
The current line highlighting feature highlights the line containing the caret. You can specify both the background and border brushes for the current line highlight.
The following screenshot shows the xamSyntaxEditor with the current line highlighting feature enabled:
The following table lists the xamSyntaxEditor control’s configurable aspects of the current line highlighting feature. Additional information follows the table.
Use the xamSyntaxEditor control’s CurrentLineHighlightVisibility
property to enable/disable current line highlighting.
The following code snippet demonstrates how to enable current line highlighting:
In C#:
this.xamSyntaxEditor1.CurrentLineHighlightVisibility = Visibility.Visible;
In Visual Basic:
Me.xamSyntaxEditor1.CurrentLineHighlightVisibility = Visibility.Visible
Use the xamSyntaxEditor control’s CurrentLineHighlightBackgroundBrush
property to set the brush used to draw the background of the current line highlight.
The following code example demonstrates how to set a solid yellow color brush for drawing the background of the current line highlight:
In C#:
this.xamSyntaxEditor1.CurrentLineHighlightBackgroundBrush =
new SolidColorBrush(Colors.Yellow);
In Visual Basic:
Me.xamSyntaxEditor1.CurrentLineHighlightBackgroundBrush = _
New SolidColorBrush(Colors.Yellow)
Use the xamSyntaxEditor control’s CurrentLineHighlightBorderBrush
property to set the brush used to draw the border of the current line highlight.
The following code example demonstrates how to set a solid red color brush for drawing the border of the current line highlight:
In C#:
this.xamSyntaxEditor1.CurrentLineHighlightBorderBrush =
new SolidColorBrush(Colors.Magenta);
In Visual Basic:
Me.xamSyntaxEditor1.CurrentLineHighlightBorderBrush = _
New SolidColorBrush(Colors.Magenta)
The following topics provide additional information related to this topic.