コード例 #1
0
        private void colorPicker_SelectedColorChanged(object sender, Infragistics.Controls.Editors.SelectedColorChangedEventArgs e)
        {
            if (e.NewColor.HasValue)
            {
                // Remove the existing DataPendingOverlayBrush resource (if any) from the XamDataPresenter Resources dictionary.
                if (this.dataPresenter1.Resources.Contains(DataPresenterBrushKeys.DataPendingOverlayBrushKey))
                {
                    SolidColorBrush brush = this.dataPresenter1.Resources[DataPresenterBrushKeys.DataPendingOverlayBrushKey] as SolidColorBrush;
                    if (brush.Color != e.NewColor.Value)
                    {
                        this.dataPresenter1.Resources.Remove(DataPresenterBrushKeys.DataPendingOverlayBrushKey);

                        // Add a new DataPendingOverlayBrush resource for the selected color to the XamDataPresenter Resources dictionary.
                        this.dataPresenter1.Resources.Add(DataPresenterBrushKeys.DataPendingOverlayBrushKey, new SolidColorBrush(e.NewColor.Value));
                    }
                }
                else
                {
                    // Add a new DataPendingOverlayBrush resource for the selected color to the XamDataPresenter Resources dictionary.
                    this.dataPresenter1.Resources.Add(DataPresenterBrushKeys.DataPendingOverlayBrushKey, new SolidColorBrush(e.NewColor.Value));
                }
            }
        }
コード例 #2
0
 private void ColorPickerControl_SelectedColorChanged(object sender, Infragistics.Controls.Editors.SelectedColorChangedEventArgs e)
 {
     m_colorSelected = true;
     m_color         = (Color)ColorPickerControl.SelectedColor;
 }