protected Theme() { var themeType = GetType(); if (Themes.ContainsKey(themeType)) { throw new Exception("Theme must be a Singleton"); } var genericDictionaries = ThemeGenericDictionaries.GetValueOrDefault(themeType); if (genericDictionaries != null) { _genericDictionaries.AddRange(genericDictionaries); } Themes[themeType] = this; var themeResourceDictionaryLoader = ThemeResourceDictionaryLoader.Instance; themeResourceDictionaryLoader.XamlResourceLoading += OnXamlResourceLoading; }