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