Exemplo n.º 1
0
        private void ColorPalette()
        {
            ColorPaletteDialog colorPaletteDialog = new ColorPaletteDialog();

            colorPaletteDialog.DataContext = Format;
            colorPaletteDialog.ShowDialog();
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        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();
        }