// create a new classification appearance map
ClassificationAppearanceMap classMap =
new ClassificationAppearanceMap();
// create a new text document appearance object
TextDocumentAppearance tda = new TextDocumentAppearance();
// change the foreground color only
tda.Foreground = new SolidColorBrush(Colors.Red);
// add a new entry in the classification map
// for the "keyword" classification type
// the last argument is true if you want to
// replace existing entry for the same
// classification type
classMap.AddMapEntry(
ClassificationType.Keyword,
tda,
true
);
// assign the classification map to the xamSyntaxEditor
this.xamSyntaxEditor1.ClassificationAppearanceMap = classMap;