I want to change the Syntax Highlighting of AvalonEdit in my Code.
XAML:
<avalonEdit:TextEditor Name="textEditor" SyntaxHighlighting="{Binding syntaxHighlighting}" />
C#:
public string syntaxHighlighting { get; set; }
public MainWindow()
{
InitializeComponent();
syntaxHighlighting = "C#";
DataContext = this;
}
But the Syntax Highlighting is not changed. What am I doing wrong? Is there a better solution for my problem?
ICSharpCode.AvalonEdit.Highlighting.HighlightingManager.Instance.GetDefinition("C#");