How to apply theme on SyntaxEditor

SyntaxEditor for WPF Forum

Posted 10 years ago by fahadash
Version: 14.1.0601

I have a SyntaxEditor instance on my Xaml-based control in my existing WPF application which is a simple application and not created through any actipro wizard.


I need to know how can I apply the theme to it my syntax editor. 


I have tried


ThemeManager.CurrenttTheme = "MetroDark";

ThemeManager.SetTheme(mySyntaxEditor, "MetroDark");


None of the above had any effect on the styling and it continues to show the White background.


Please tell me how do I change the theme ?

Comments (2)

Answer - Posted 10 years ago by fahadash

I found the answer. I did not have the ActiproSoftware.Themes.Metro.Wpf.dll referenced. And I was registering the catalog.

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA


You want to only use ThemeManager.CurrentTheme since that is an app wide setting.  The SetTheme method is just for testing.  But to answer your question, as you found, the Metro themes require some additional setup since they ship in a separate assembly and need to be registered so that they can be used.  The "Getting Started" topic of the Themes documentation walks you through what to do if you have any trouble.

However please note that even once you get the Metro Dark theme active, you would need to load up or override the highlighting styles that are used by SyntaxEditor to do syntax highlighting.  We show one way of doing that sort of thing in our Sample Browser project's SyntaxEditorHelper.UpdateHighlightingStyleRegistryForThemeChange method.

Actipro Software Support

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.