Can't change the requested theme of the syntax editor

SyntaxEditor for Universal Windows Forum

Posted 11 years ago by Islam Taha
Version: 14.1.0141
Avatar

i can't change the theme of the editor  and when building the project with RequestedTheme = "Dark" or else an Exception is thrown without changing the theme from the xaml code or from the Csharp code ... what is the problem ? how to change the requested theme ? 

Comments (5)

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

Hello,

I just tried RequestedTheme="Dark" in our sample project's App.xaml and it worked all right for me.  Does our sample project work ok for you if you do the same thing there?

What specifically is the exception you are receiving and how can we reproduce it in our sample project?


Actipro Software Support

Posted 11 years ago by Islam Taha
Avatar

This is the exception i get in xaml designer -> = (Exception: Cannot find resource named 'TargetType=ActiproSoftware.Windows.Themes.SharedResourceKeys ID=ExpanderStyleKey'. Resource names are case sensitive.)

I mean by the requested theme that of the syntax editor not all of the page, how can i change the theme of the syntax editor to dark ???

thanks for replying

Posted 11 years ago by Islam Taha
Avatar

this exception is also thrown in your project code ??

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

Ok you mean in the VS designer.  It looks like Microsoft has added some bugs in the designer that aren't properly finding resources that are used by our designer integration code.  For instance, I can sometimes open the solution, make the change to the RequestedTheme, and it wll work fine.  And then if I make any other changes this problem starts happening where the resource isn't found.  Then I have been able to close the designer, rebuild, and reopen it and have it work.  We will contact Microsoft on this to see what they can do to help fix it.

If you do the code in XAML only mode or C# code behind, you shouldn't run into the designer issue and it will execute at run-time.

That being said, SyntaxEditor doesn't currently define a separate dark theme.  It will use brushes like TextBoxBackgroundThemeBrush (system ones) that come from the app's theme, meaning it will be dark if your app's theme is Dark.  You can alter properties like SyntaxEditor.Background, BorderBrush, etc. to override that.  But to affect the text area, you would need to update the highlighting styles that are registered for each classification type used by the syntax languages you harness.  By default the highlighting styles we define in our languages are for a light background editor.  All of that is easily changed though, especially if you are just using a dark theme since you can change the various colors right in the languages.


Actipro Software Support

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

We have submitted a bug report to the VS team on Connect.  Please vote up this link to help support Microsoft looking into it:

https://connect.microsoft.com/VisualStudio/feedback/details/843637/vs-2013-designer-errors-out-after-rebuild-when-using-custom-controls-with-designer-extensibility


Actipro Software Support

The latest build of this product (v22.1 build 0365) was released 11 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.