private void OnPlayerAppearanceColorChange(object sender, EventArgs e) { var item = this._PlayerAppearanceColorListBox.SelectedItem as SaveFormats.MorphHead.VectorParameter; if (item != null) { var bgra = LinearColorToBgra(item.Value); // ReSharper disable UseObjectOrCollectionInitializer var picker = new ColorPicker.ColorDialog(); // ReSharper restore UseObjectOrCollectionInitializer picker.WheelColor = bgra; if (picker.ShowDialog() != DialogResult.OK) { return; } item.Value = BgraToLinearColor(picker.WheelColor); } }
// // ToolStripButton Textcolor wurde gedrückt // private void ToolStripButtonTextcolor_Click(object sender, RoutedEventArgs e) { var colorDialog = new ColorDialog(); //colorDialog.Owner = this; var showDialog = colorDialog.ShowDialog(); if (showDialog == null || !((bool) showDialog)) return; var range = new TextRange(RichTextControl.Selection.Start, RichTextControl.Selection.End); range.ApplyPropertyValue(FlowDocument.ForegroundProperty, new SolidColorBrush(colorDialog.SelectedColor)); }