This announcement has been done along with the launch of the Silverlight tools for Visual Studio 2010. Although this news was overwhelmed by the tools announcement, I think is very interesting since they are defining (or at least proposing) a standard for the definition of a complete theme structure for Silverllight …

We have been expecting a sample like this, because it is shows clearly the purpose of Silverlight & WPF for separating the Designer and Developer concerns and enables to showcase Blend as an efficient designer tool: Disconnect the interaction between the designer and on the part associated with the developer.

This separation of concerns was improved greatly with the appearance of behaviors in Blend 3.0 and Silverlight and now is better with improved support for Blend 4.0 (beta) and SL 4.0.

For now, the way to “handle” all this themes is to manually place a series of files in a folder of “Assets” which if done right includes various styles files, resource libraries, behaviors – see http://storage.timheuer .com/newthemes-structure1.png for a clearer picture – also this themes can incorporate any Font, image or video, according to the style in question.

This in itself is rather large achievement as we can decouple the interaction of styles and is relatively simple …. for a Developer … for a “pure” designer this is complex and costs understanding and concentration…

I am proposing an evolution of this already great proposal, to make it greater..this is to further simplify the interaction model for the themes which enables to create and work on them separately, uncoupling them from the application, assigning them its own “theme” project type, like “cosmopolitan.theme.dll” wich is nothing else than a Silverlight class library with a assigned dll.

This way, a designer can create a theme library like “Cosmopolitan.theme.dll”and the application can change the theme at any time using the theme dll without the need of having to delete files of styles, behaviors, images, fonts, etc … (which costs time and is prone to errors).

This also enables to have several associated themes and change them as we want through code or, better, a behavior.

There are some clear advantages of my proposal:

The designer can abstract from the complexity of the application and focus only on the design of the theme and its styles.

The designer avoids touching any code sensitive for the developer, even accidentally – favoring the separation and decoupling.

We favor a potential marketplace for “themes” for Silverlight. If I want to sell themes, it would be good that the technology supports them as separate beings.

Promotes the theme reuse for creating other themes, thus stimulating creativity and competitiveness “between designers (and also some developers).

It will make very visible at last the advantage of Blend and Silverlight to fully decouple the visual aspect and interaction with the application development. (Very necessary).

On the other hand is very easy to set up a generic test project in which multiple pages are displayed that showcases all controls, SL controls, SDK controls, graphics, Toolkit controls as well as it would be easy to add our own controls dynamically. .. This would make wonderfully simple for the designer to test his theme very easily…

And, as a firm petition, this would be fantastic if this was enabled into Silvelright and it integrated on Blend

On the other hand, the type of proposed type of dll “theme.dll” is that of a normal Silverlight class library, it would be easy to make a “base template project” with implementations of all controls by default. This would mean to only change or add a template to these themes dll’s… and modify the existing ones to allow dynamic loading and unloading based directory Assets, for instance). MEF we would allow to do this very easily ..

How do you see this? If you think this is a good idea, please vote for it on the Silverlight feature request! Let’s help everybody to make this technology a huge success!

Here are the slides and codes from past Thursday presentation at the Bartlesville NET User Group, I was honored to join you at your past meeting :).

Sadly it was a virtual event so I could not enjoy the free lunch nor participate in a more direct way, which is something you loose for the extremely reduced travel costs that Live Meeting brings on to all .NET user’s group!

Thanks Ankesh for organizing it so amazingly and thanks to everybody that assisted, being heard is a big thing.

The slides are hereand the code is here. Have fun and please answer to this post if there is any issue with this.

Have fun!

search

About...

Passionate about development, .NET, XAML (WPF, Silverlight, Windows Phone, Windows 8...) and all the incredible things we are able to do with them... I will try to provide some of my experiences with it here on this blog, I do hope you like it ;)