Lightswitch extensions: theming vs shelling.

I actually had this little post about theming vs shelling in my drafts for two weeks now, but I never got around to actually posting it.

I’m quite sure that the person this post was intended for, will have figured this out by him/herself by now, but when I saw that the Microsoft LightSwitch team released the second official theme today (besides the “standard” one): the Metro UI theme, and thought I’d post this anyways, so here we go…

The look and feel of your LightSwitch application, is almost completely determined by the theme and shell that you use.

The difference between the two is easily explained…
The theme is the “look” of your application: the colors (brushes), the font family, style and weight, the style of your controls, and even their control template.
The shell is the “feel” of your application: where do I put the menu bar and how do I interact with it? Left, right, above or below the active screen? Can I use F5 to refresh the active screen?  How about ctrl+S?

It is not quite clear by following the two walkthroughs on MSDN, but a theme extension is actually way bigger then a shell extension.  To put it quite bluntly: a shell extension can be compared to big layout control, whereas the theme extension contains info for almost everything you see and interact with as an end-user.

(Note: the walkthrough on MSDN about the theme extension has a link at the bottom to a page that briefly mentions control elements for LS themes, but any documentation regarding this is hard to find, so I prepared a sample on this subject for a post later this weekend…)

I saw a post on the MSDN forums from someone wondering if “any custom theme will fit any custom shell”? The truth is quite simple: yes, unless your shell extension developer failed to follow a couple of simple rules:

  • When creating a shell extension, use only the resources defined by the default theme extension.
  • Try not to create or use custom controls in your shell extension.  If you do create new controls,  use only brushes defined by the default theme extension and realize that the end-user might want to use a different theme that looks totally different then your custom control.
  • When deploying a shell extension, feel free to include your custom theme extension in the same vsix file (yes, you CAN package two modules in one installer), as a suggestion to the user of a theme that fits your shell nicely, but don’t assume the user will only ever want to use your theme.
Advertisements

2 thoughts on “Lightswitch extensions: theming vs shelling.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s