Ejemplo n.º 1
0
        /// <summary>
        /// This function is called when a new color is selected
        /// </summary>
        /// <param name="color">The name of the selected color</param>
        public void AccentColorChanged(string color)
        {
            var theme = ThemeManager.DetectAppStyle(Application.Current);

            ThemeManager.ChangeAppStyle(App.Current, ThemeManager.GetAccent(color), theme.Item1);

            writer.SetTheming(color, theme.Item1.Name);
        }
Ejemplo n.º 2
0
        public void ColorWriter_SetThemeing_SetsThemeingCorrectly()
        {
            var reader = new FakeColorReader();

            reader.multiple = true;

            ColorWriter writer = new ColorWriter(reader);

            writer.SetTheming("Mauve", "BaseDark");

            bool theme  = false;
            bool accent = false;

            foreach (string s in reader.NewFile)
            {
                if (s == "THEME:BaseDark")
                {
                    theme = true;
                }

                if (s == "ACCENT:Mauve")
                {
                    accent = true;
                }
            }

            Assert.IsTrue(theme);
            Assert.IsTrue(accent);
        }