public SkinPage() { InitializeComponent(); this.DataContext = YingConfig.YArgs; PresetColorList.ItemsSource = PresetColors; tempColor = (Color)Application.Current.Resources["ThemeColor"]; _colorASlider.Value = tempColor.A; _colorRSlider.Value = tempColor.R; _colorGSlider.Value = tempColor.G; _colorBSlider.Value = tempColor.B; _colorASlider.ValueChanged += (s, e) => { if (e.NewValue == 0) { return; } tempColor.A = (byte)_colorASlider.Value; Update_ThemeColor(); }; _colorRSlider.ValueChanged += (s, e) => { tempColor.R = (byte)_colorRSlider.Value; Update_ThemeColor(); }; _colorGSlider.ValueChanged += (s, e) => { tempColor.G = (byte)_colorGSlider.Value; Update_ThemeColor(); }; _colorBSlider.ValueChanged += (s, e) => { tempColor.B = (byte)_colorBSlider.Value; Update_ThemeColor(); }; PresetColorList.SelectionChanged += (s, e) => { var SelectedColor = PresetColorList.SelectedItem as MyColor; tempColor = (Color)ColorConverter.ConvertFromString(SelectedColor.Color); _colorASlider.Value = tempColor.A; _colorRSlider.Value = tempColor.R; _colorGSlider.Value = tempColor.G; _colorBSlider.Value = tempColor.B; YingApp.UpdateThemeColorBrush(tempColor); }; _backButton.Click += (s, e) => NavigationService.GoBack(); }
private void Slider_Thumb_DragCompleted(object sender, System.Windows.Controls.Primitives.DragCompletedEventArgs e) { YingApp.UpdateThemeColorBrush(tempColor); }