public SelectColorControl() { InitializeComponent(); SelectedColor = ConfigHelper.BackgroundColor; SelectedColor.PropertyChanged += SelectedColorOnPropertyChanged; this.Dispatcher.ShutdownStarted += (sender, args) => { if (selectBackround.IsChecked.Value) { ConfigHelper.BackgroundColor = SelectedColor; } if (selectDownload.IsChecked.Value) { ConfigHelper.DownloadColor = SelectedColor; } if (selectUpload.IsChecked.Value) { ConfigHelper.UploadColor = SelectedColor; } }; }
private void selectUpload_Checked(object sender, RoutedEventArgs e) { SelectedColor = ConfigHelper.UploadColor; SelectedColor.PropertyChanged += SelectedColorOnPropertyChanged; }