Lexer theme support

SyntaxEditor for WPF Forum

Posted 2 years ago by Mike
Version: 17.2.0664
Avatar

Hi,

if I define a foreground color in lexer for a custom language, how can I take care of different themes? I didn't found a way to specify a system color on lexer instead only a fixed color is allowed. Would I need to create two language lexer files for each theme (white/dark) or can I create one language file and modify the color within the source code of the app?

Comments (1)

Answer - Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Mike,

You would just have one lexer file, usually with light default colors in it.  Please check out the "SyntaxEdtior / User Interface Features / Theme and Highlighting Style Features / Highlighting Style Registries" topic in the documentation that comes with the product.  That tells you how to set up handling for a dark theme.  Our sample project also shows it, with a lot of the code being in the "SyntaxEditorHelper.UpdateHighlightingStyleRegistryForThemeChange" method in the /ProductSamples/SyntaxEditor/Common" folder.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.