private void ColorPalette() { ColorPaletteDialog colorPaletteDialog = new ColorPaletteDialog(); colorPaletteDialog.DataContext = Format; colorPaletteDialog.ShowDialog(); }
private void colorButton_Click(object sender, EventArgs e) { var callingButton = (ColorButton)sender; var p = new Point(callingButton.Left, callingButton.Top + callingButton.Height); p = PointToScreen(p); var clDlg = new ColorPaletteDialog(p.X, p.Y); clDlg.ShowDialog(); if (clDlg.DialogResult == DialogResult.OK) { _color = clDlg.Color; } callingButton.CenterColor = _color; Invalidate(); clDlg.Dispose(); }
public override void Execute(object parameter) { object[] values = (object[])parameter; UserControl userControl = (UserControl)values[0]; int colorPosition = (int)values[1]; PaletteIndex paletteIndex = PaletteIndex.Palette0; if (values.Length > 2) { paletteIndex = (PaletteIndex)values[2]; } Window window = Window.GetWindow(userControl); ColorPaletteDialog dialog = new ColorPaletteDialog(paletteIndex, colorPosition) { Owner = window }; dialog.ShowDialog(); }