var dictionaries = Resources.MergedDictionaries;
dictionaries.Clear();
string source = String.Format("/CommonUI;component/Resources/{0}.xaml", value == AppStyleSet.Light ? "WP7Style_Light" : "WP7Style_Dark");
//base styles
var themeStyles = new ResourceDictionary {Source = new Uri(source, UriKind.Relative)};
dictionaries.Add(themeStyles);
var generalStyles = new ResourceDictionary();
generalStyles.Source = new Uri("/CommonUI;component/Resources/Styles.xaml",UriKind.Relative);
dictionaries.Add(generalStyles);
... <Setter Property="Color" Value="{StaticResource HighlightColor}" />