• Products
  • Download
  • Purchase
  • Support
  • Company
Actipro Software company logo
Twitter Follow Actipro RSS Subscribe (RSS Feed)

The Actipro Blog

Tag Cloud

  • aero
  • blog
  • docking
  • editors
  • gauge
  • intelliprompt
  • navigation
  • propertygrid
  • ribbon
  • shared library
  • silverlight
  • syntaxeditor
  • themes
  • views
  • winforms
  • wpf

Latest Twitter News

November 21, 2011 at 11:14 AM
#WPF Studio 2011.2 is out now! Includes enhanced themes for native WPF conrtols and new SyntaxEditor features. http://t.co/uEMCaGPG

September 26, 2011 at 1:25 PM
If you'd like to see our #WPF / #Silverlight SyntaxEditor code editor control ported to Metro, provide feedback here: http://t.co/xXBNIDTi

September 15, 2011 at 8:31 PM
If you want to see SyntaxEditor eventually show up in Win8's #xaml UI, be sure to add your support to this MS thread: http://t.co/FBjz6TuC

August 15, 2011 at 1:47 PM
New SyntaxEditor IntelliPrompt parameter info feature docs/samples ready for the 2011.2 #WPF and #Silverlight releases. http://t.co/ezoYIjv

August 2, 2011 at 2:40 PM
First look at new automated IntelliPrompt parameter info coming to our C#/VB editor control in #WPF / #Silverlight http://t.co/CUz6O1T

Twitter Follow us on Twitter

Month List

  • 2012
    • February (3)
    • January (2)
  • 2011
    • December (2)
    • November (7)
    • October (2)
    • September (1)
    • August (5)
    • July (3)
    • June (6)
    • May (5)
    • April (8)
    • March (4)
    • February (5)
    • January (9)
  • 2010
    • December (9)
    • November (10)
    • October (4)
    • September (8)
    • August (12)
    • July (9)
    • June (7)
    • May (6)
    • April (7)
    • March (6)
    • February (6)
    • January (4)
  • 2009
    • December (2)
    • November (2)
    • October (12)
    • September (3)
    • August (11)
    • July (10)
    • June (6)
    • May (3)
    • April (7)
    • March (6)
    • February (8)
    • January (10)
  • 2008
    • December (10)
    • November (2)
    • October (3)
    • September (5)
    • August (5)
    • July (8)
    • June (4)
    • May (4)
    • April (10)
    • March (8)
    • February (1)
    • January (2)

Category List

  • RSS feed for ActiproActipro (289)
  • RSS feed for Blog SummaryBlog Summary (13)
  • RSS feed for GeneralGeneral (34)
  • RSS feed for In developmentIn development (150)
  • RSS feed for New featuresNew features (140)
  • RSS feed for New productNew product (30)
  • RSS feed for PromotionPromotion (2)
  • RSS feed for SilverlightSilverlight (71)
  • RSS feed for Tips and tricksTips and tricks (4)
  • RSS feed for Visual Studio 2008Visual Studio 2008 (2)
  • RSS feed for Windows FormsWindows Forms (20)
  • RSS feed for Windows VistaWindows Vista (10)
  • RSS feed for WPFWPF (235)
  • RSS feed for XAMLXAML (23)

About Us

Actipro Software is a leading provider of .NET user interface controls for the WPF, Silverlight, and WinForms frameworks, and is most well-known for their SyntaxEditor syntax-highlighting code editor control.

Please take some time to learn more about us and our product offerings.

SyntaxEditor for WPF - Advanced themes and highlighting style features

April 15, 2009 at 11:04 PM
by Bill Henning (Actipro)

The past several days we’ve been cleaning up code (running code analysis, fixing XML comment errors, making sure all strings are resources, etc.) as we finalize the features for the first public beta of SyntaxEditor for WPF.

One area that still needed some work is themes and how highlighting styles function.  We implemented a lot of neat features that will make it easy to have your apps work just like how Visual Studio does. 

Configurable UI properties via XAML

First, as a base default for themes, we allow easy configuration of SyntaxEditor UI elements via simple properties on the SyntaxEditor class.  For instance, say you’d like to set the background of the line number margin.  For that, you’d use set the LineNumberMarginBackground property.  Want to set the font size as well?  You’d use the LineNumberMarginFontSize property. 

These properties can be set via XAML Styles, directly in XAML on SyntaxEditor instances, or programmatically.

That’s all fine and good, however we wanted to allow you to get really advanced by optionally giving end users the ability to change all aspects of the editor UI.  Some end users really value the ability to create dark or other alternate themes for their editors.

Using display item classification types and related styles

As we looked at Visual Studio’s settings dialog, on the Fonts and Colors page, you can change the styles used for all logical classification types.  However they also have special classification types for things like Plain Text and Line Numbers etc.

We’ve updated our own infrastructure to define several similar “special” display item classification types.  If you choose to register them, they will appear in our version of the Fonts and Colors page and will allow end users to override those aspects of the editor’s UI. 

In terms of priority, any non-default value of a display item style will take precedence over a related default SyntaxEditor property setting (described in the previous section).  If the display item style’s property is a default value, the fallback value of the SyntaxEditor property setting is used.

Options 

In the screenshot above you can see the first four items in the list are the new special display item classification types.  All the rest were added for specific languages.  The classification types are also properly ordered such that Plain Text, being the most important, appears at the top of the list, followed by other special display items.  Then the remainder of classification types are sorted alphabetically.  The classification types are automatically sorted this way for you via the IHighlightingStyleRegistry.ClassificationTypes property, which is what the ListBox is bound to.

Regarding the controls on the right of the list, we currently are using the brush picker included in the Sample Browser, but in the final WPF Studio 5.0 release we plan on using a new BrushEditBox that is part of Editors for WPF.  We have built a small text style preview control that appears at the bottom right of the screenshot.  It updates dynamically when a new display item is selected, or one of the related style properties is changed.  This small preview control is included with SyntaxEditor.

So to sum up, when the display item classification types feature is used, end users can change the style properties for Plain Text, etc.  Changing the Plain Text style alters the default foreground and background of the editor.  Line Numbers alters the foreground/background of the line number margin, etc.  With these features, it’s easy to implement an options dialog just like in Visual Studio.  The screenshot above is from our open source QuickStart.

Dynamic updates to UI

Regardless of whether you change the standard WPF display properties on the SyntaxEditor or if you change display item classification type styles, the changes are reflected immediately in the SyntaxEditor user interface.

End-user editing capabilities of highlighting styles

During our work, we also found that for some styles, it doesn’t make sense for users to be able to alter certain properties.  For instance, a Visual White Space display item only needs to have its Foreground configurable.  It wouldn’t make sense to allow Bold or Italic. 

Thus we have also updated our IHighlightingStyle interface to have properties that indicate which properties can be altered in a user interface.

DisabledStyleItems

In the screenshot above you can see how the Indicator Margin display item only allows the item background to be selected since none of the other properties really make sense for that item.

Importing Visual Studio .vssettings files for themes

One final thing we did to really show off these new features is to allow import of Visual Studio .vssettings files to define the styles used in the editor.  This is really cool.

A while back, Scott Hanselman posted links to a bunch of VS themes that people have defined.  See this URL:

http://www.hanselman.com/blog/VisualStudioProgrammerThemesGallery.aspx

So with one line of code, SyntaxEditor can import any of these settings files and update itself appropriately.  Our main demo will show this off once released.  It has an Import Visual Studio Settings… menu item on the File menu that allows you to pick a .vssettings file and import it, even in XBAP.

Here are some screenshots of various themes from that site loaded into SyntaxEditor:

Slimcode

Ragnarok

Distant

Dark

Again, all it took was one line of code to load those.

Nearing public beta release

I know a lot of you are anxious to get your hands on this product to start working with it.  I hope by these blog posts, you can see the level of detail we’re putting into the design of features and why the product has taken a while to get to this point.

We plan on starting on documentation topics and adding some preliminary designer support shortly.  After that, it should be ready for public beta!

Tags: wpf, syntaxeditor
Filed under: Actipro, In development, WPF
Submit to DotNetKicks...
Permalink | Comments (2)

Related posts

Themes for WPF Part 1 - Native WPF Control Themes In prior blog posts, we’ve detailed some of the great new features coming to the WPF SyntaxEditor ...SyntaxEditor for WPF - Highlighting style configuration part 2Thanks for your comments on this post and via email on yesterday’s post about getting input on...SyntaxEditor for WPF - Need input on highlighting style configurationSorry we haven’t made any new SyntaxEditor for WPF posts recently.  We’ve been hamm...

Comments

May 29, 2009 at 00:14  

Terry Walker

That’s great, I never thought about Dynamic updates like that before.

Terry Walker United States

August 18, 2009 at 14:04  

trackback

Actipro Blog 2009 Q2 posting summary

Actipro Blog 2009 Q2 posting summary

The Actipro Blog - WPF and WinForms Development

Comments are closed
Copyright © 1999-2012 Actipro Software LLC. All rights reserved.
Home Actipro Software | Products | Download | Contact Us