Exemple #1
0
        private void SetTheme(ResourceDictionary resourceDictionary, bool invokeOnThemeChanged)
        {
            var themeResourceDictionary = resourceDictionary as IThemeResourceDictionary;

            if (themeResourceDictionary == null)
            {
                throw new Exception("Invalid resource dictionary type");
            }

            var mergedDictionaries = Application.Current.Resources.MergedDictionaries;

            if (mergedDictionaries != null)
            {
                CurrentTheme = themeResourceDictionary;
                platformThemeManager.SetTheme(themeResourceDictionary);
                ReplaceThemeResourceDictionaries(mergedDictionaries, resourceDictionary);

                if (invokeOnThemeChanged)
                {
                    OnThemeChanged(themeResourceDictionary);
                }
            }
        }
Exemple #2
0
 public void SetTheme(IThemeResourceDictionary themeResourceDictionary)
 {
     SetStatusBar(themeResourceDictionary.ThemeColorExtractor.SecondaryColor);
 }