Project Description
This library allows users to provide their own resource dictionaries to replace the default theme dictionaries loaded by WPF. This makes it so you don't have to decorate custom styles with BasedOn="{StaticResource {x:Type ...}}" when your own custom theme is being used in your application. It also makes it so if you have custom controls that just provide enhanced capability and don't need to replace the the style, you don't need to define a new style or override the DefaultStyleKey when you create the custom control.

It's important to understand that you will be replacing the entire theme for a given assembly. So you need to have a complete theme that has a style for every control in the assembly. So I highly advise starting with the Aero or Royale theme and replacing bits of the theme as you go.

Also, real WPF themes won't resolve DynamicResources that are contained in the same resource dictionary. They need to be located outside of the theme dictionary. So keep that in mind when converting other themes people have written when using the WPF Theme Replacer. Most of the time you'll probably just be changing DynamicResources to StaticResources. For anything else, you should be using component keys to resolve a DynamicResource.

Here's an example of loading my own version of the Royale theme in my project. Note you would need to have downloaded your own copy of the Royale or Aero theme into your project to do this. You can obtain the Royale theme here or Aero theme here.

using QuixoticLabs.Presentation;
ResourceDictionary royale = Application.LoadComponent(
    new Uri("QuixoticLabs.Presentation.Test;component/Themes/Royale.xaml", UriKind.Relative))
    as ResourceDictionary;

ThemeReplacer.AddTheme(ThemeReplacer.PresentationFramework, royale);

Additional details on the inner-workings and other WPF stuff:

Last edited Feb 6, 2010 at 3:18 PM by NickDarnell, version 16