Exemplo n.º 1
0
        private static void ShowColorDialog(GradientStop gradientStop)
        {
            var colorDialog = new ColorDialog
            {
                OldColor = gradientStop.Color,
                Color = gradientStop.Color,
            };

            colorDialog.ShowDialog();

            if (colorDialog.DialogResult.GetValueOrDefault())
                gradientStop.Color = colorDialog.Color;
        }
Exemplo n.º 2
0
 private void ShowColorDialog(object sender, RoutedEventArgs eventArgs)
 {
     var colorDialog = new ColorDialog();
     colorDialog.ShowDialog();
 }
Exemplo n.º 3
0
        private void OnButtonClick(object sender, RoutedEventArgs eventArgs)
        {
            // Start color picker dialog and use new color.
            var dialog = new ColorDialog
            {
                OldColor = Color,
                Color = Color
            };

            dialog.ShowDialog();

            if (dialog.DialogResult.GetValueOrDefault())
                Color = dialog.Color;
        }