public void UpdateAssemblyAccent() { string theme = CultureInfo.CurrentCulture.TextInfo.ToTitleCase( Enum.Parse(typeof(Accents), ApplicationAccent.ToString()).ToString()); try { Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri("/Quickbeam;component/Themes/" + theme + ".xaml", UriKind.Relative) }); } catch { Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri("/Quickbeam;component/Themes/Blue.xaml", UriKind.Relative) }); } }
public static void ApplyAccent() { var theme = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Enum.Parse(typeof(Accents), ApplicationAccent.ToString()).ToString()); try { Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri("/UsermapConverter;component/Metro/Themes/" + theme + ".xaml", UriKind.Relative) }); } catch { Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri("/UsermapConverter;component/Metro/Themes/Blue.xaml", UriKind.Relative) }); } }