private void ColorsSelectorOnSelectionChanged(object sender, SelectionChangedEventArgs e) { var selectedColor = this.ColorsSelector.SelectedItem as KeyValuePair <string, Color>?; if (selectedColor.HasValue) { var theme = ThemeManager.DetectAppStyle(this); ThemeManagerHelper.CreateAppStyleBy(selectedColor.Value.Value, true, this); ThemeManagerHelper.CreateAppStyleBy(selectedColor.Value.Value, true); Settings = new ClientSettings(theme.Item1.Name, selectedColor.Value.Value); Settings.SerializeSetting(); } }
public void SetSetting(Window win) { try { if (accent != null) { ThemeManager.ChangeAppStyle(Application.Current, ThemeManager.GetAccent(accent), ThemeManager.GetAppTheme(appTheme)); } else { var theme = ThemeManager.DetectAppStyle(Application.Current); ThemeManager.ChangeAppStyle(Application.Current, theme.Item2, ThemeManager.GetAppTheme(appTheme)); ThemeManagerHelper.CreateAppStyleBy(color, true); } } catch { } }