Another way that worked for me:
using (var stream = new MemoryStream(WpfApp15.Properties.Resources.sql))
{
using (var reader = new System.Xml.XmlTextReader(stream))
{
this.AvalonQuery.SyntaxHighlighting =
ICSharpCode.AvalonEdit.Highlighting.Xshd.HighlightingLoader.Load(reader,
ICSharpCode.AvalonEdit.Highlighting.HighlightingManager.Instance);
}
}
You need to change WpfApp15and sql.
I have used Project > ... Properties > Resources > Add Resource > Add Existing File....
source
share