Exemplo n.º 1
0
        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)
                });
            }
        }
Exemplo n.º 2
0
        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)
                });
            }
        }