public virtual void ReplaceAccentColor(Swatch swatch) { if (swatch == null) { throw new ArgumentNullException(nameof(swatch)); } var palette = QueryPalette(); foreach (var color in swatch.AccentHues) { ReplaceEntry(color.Name, color.Color); ReplaceEntry(color.Name + "Foreground", color.Foreground); } var hue = swatch.AccentHues.ElementAt(palette.AccentHueIndex); ReplaceEntry("SecondaryAccentBrush", new SolidColorBrush(hue.Color)); ReplaceEntry("SecondaryAccentForegroundBrush", new SolidColorBrush(hue.Foreground)); }
private static void ApplyAccent(Swatch swatch) { new PaletteHelper().ReplaceAccentColor(swatch); }
private static void ApplyPrimary(Swatch swatch) { new PaletteHelper().ReplacePrimaryColor(swatch); }