Example #1
0
        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));
        }
Example #2
0
 private static void ApplyAccent(Swatch swatch)
 {
     new PaletteHelper().ReplaceAccentColor(swatch);
 }
Example #3
0
 private static void ApplyPrimary(Swatch swatch)
 {
     new PaletteHelper().ReplacePrimaryColor(swatch);
 }