private void IsDarkMode_Unchecked(object sender, RoutedEventArgs e) { EnableDarkMode(false); ChangeAppColor.ChangePrimaryColor(paletteHelper, Colors.White); ChangeAppColor.ChangeSecondaryColor(paletteHelper, Colors.White); ChangeAppColor.ChangePrimaryColor(paletteHelper, PrimaryColor.Color); ChangeAppColor.ChangeSecondaryColor(paletteHelper, PrimaryColor.Color); }
private void Theme_Control_Loaded(object sender, RoutedEventArgs e) { if (iniFile.KeyExists("DarkMode", "Theme")) { EnableDarkMode(Convert.ToBoolean(iniFile.Read("DarkMode", "Theme"))); IsDarkMode.IsChecked = Convert.ToBoolean(iniFile.Read("DarkMode", "Theme")); } if (iniFile.KeyExists("PrimaryColor", "Theme")) { string primaryColor = iniFile.Read("PrimaryColor", "Theme"); ChangeAppColor.ChangePrimaryColor(paletteHelper, (Color)ColorConverter.ConvertFromString(primaryColor)); ChangeAppColor.ChangeSecondaryColor(paletteHelper, (Color)ColorConverter.ConvertFromString(primaryColor)); PrimaryColor.Color = (Color)ColorConverter.ConvertFromString(primaryColor); } }
// Change PrimaryColor private void PrimaryColor_PreviewMouseMove(object sender, System.Windows.Input.MouseEventArgs e) { ChangeAppColor.ChangePrimaryColor(paletteHelper, PrimaryColor.Color); iniFile.Write("PrimaryColor", PrimaryColor.Color.ToString(), "Theme"); ChangeAppColor.ChangeSecondaryColor(paletteHelper, PrimaryColor.Color); }