public static ResourceDictionary AddMaterialDesign(this ResourceDictionary resourceDictionary, bool add = true) { addCache = add; if (add) { var colorTheme = new CustomColorTheme() { BaseTheme = BaseTheme.Light, PrimaryColor = (Color)ColorConverter.ConvertFromString("#01579b"), SecondaryColor = Brushes.DarkGreen.Color }; var thisAssembly = typeof(Extensions).Assembly; resourceDictionary.MergedDictionaries.Add(colorTheme); resourceDictionary.AddXamlResource(@"Views\DefaultViews.xaml", thisAssembly); resourceDictionary.AddXamlResource(@"AppStyles\Default.xaml", thisAssembly); } return(resourceDictionary); }
public static ResourceDictionary AddDefaultViews(this ResourceDictionary resources) { resources.AddXamlResource("Views/DefaultViews.xaml", typeof(ViewsExtensions).Assembly); return(resources); }
public static void AddXamlResource(this ResourceDictionary dictionary, string xamlFileName, Assembly xamlFileAssembly) { dictionary.AddXamlResource(xamlFileName, xamlFileAssembly.GetName().Name); }