public ColorPickerDialog() { InitializeComponent(); SelectedColors.ItemsSource = __SavedColors; CommandBinding cb = new CommandBinding(ColorPicker.AddToSelected); cb.Executed += new ExecutedRoutedEventHandler(AddToSelected); cb.CanExecute += new CanExecuteRoutedEventHandler(CanAddToSelected); CommandBindings.Add(cb); cb = new CommandBinding(ColorPickerDialog.RemoveColorCommand); cb.Executed += new ExecutedRoutedEventHandler(RemoveColor); cb.CanExecute += new CanExecuteRoutedEventHandler(CanExecuteAlways); CommandBindings.Add(cb); cb = new CommandBinding(ColorPickerDialog.RemoveAllColorsCommand); cb.Executed += new ExecutedRoutedEventHandler(RemoveAllColors); cb.CanExecute += new CanExecuteRoutedEventHandler(CanExecuteAlways); CommandBindings.Add(cb); SelectedColors.Focus(); }
public MonthColors(Month month) { m_month = month; m_trailingColors = new TrailingColors(this); m_weekendColors = new WeekendColors(this); m_disabledColors = new DisabledColors(this); m_selectedColors = new SelectedColors(this); m_focusColors = new FocusColors(this); m_dayColors = new DayColors(this); // Default values m_backColor1 = Color.White; m_backColor2 = Color.White; m_gradientMode = mcGradientMode.None; }
private void GetAvgColor_Click(object sender, RoutedEventArgs e) { byte[] colors = GetAverageColor(); SelectedColors.SetColor1(colors[0], colors[1], colors[2], colors[3]); SelectedColors.SetColor2(colors[4], colors[5], colors[6], colors[7]); }