Aug
18
2009

WPF Themes

Themes in WPF are pretty much the same concept as the ASP.NET one. All controls in WPF are styleless (I'll ignore the spell check) and when developing they should be left as such. In other words disregard all the examples on the internet that have the styles with the controls together. They should be separate and the look and feel should be controlled by themes. That is the rule which covers the majority of cases, the exceptions could be handled whichever way you wish, just make sure you inherit from a style you control in your themes. You can do this by using the BasedOn attribute.

After I spend quite some time looking for free themes on the internet, I came to the following conclusions. There are a lot of themes out there for Silverlight here or here but none for WPF.  Unless of course you would like to pay the guys at XAML Templates and get a really good looking style theme for your app.

Well I came across the MSDN WPF ControlTemplate Examples where Microsoft has done a very good job putting together the complete theme for the controls. Well I modified it a little, changed a few colors and you can download my version below. If you wish to modify the theme you only need to make changes to the Shared file.

Also my travels through the internet took me to a very useful post here by nextrapixel, that is a collection of incredibly good free tools for designers (or not) to pick the best or the worst color palette for their app. I should point out though that this Color Explorer and this Color Blender stand out.

Unzip the files below and add them to you project. Then add the code below to the App.xaml file.

    <Application.Resources>
        <ResourceDictionary Source="Themes/DefaultTheme.xaml" />         
    </Application.Resources>

Themes.rar (31.14 kb)