ResourceDictionary GetTheme(string color, string accent) { string themeName = string.Format("NoesisTheme.Brushes.{0}{1}.xaml", color, accent); ResourceDictionary theme; if (ThemeDictionaries.TryGetValue(themeName, out theme)) { return(theme); } Uri uri = new Uri("pack://application:,,,/Noesis.GUI.Extensions;component/Theme/" + themeName, UriKind.RelativeOrAbsolute); theme = new ResourceDictionary { Source = uri }; ThemeDictionaries.Add(themeName, theme); return(theme); }
ResourceDictionary GetTheme(string color, string accent) { string themeName = string.Format("NoesisTheme.Brushes.{0}{1}.xaml", color, accent); ResourceDictionary theme; if (ThemeDictionaries.TryGetValue(themeName, out theme)) { return(theme); } Uri uri = new Uri("Assets/NoesisGUI/Theme/" + themeName, UriKind.Relative); theme = new ResourceDictionary { Source = uri }; ThemeDictionaries.Add(themeName, theme); return(theme); }