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;
        }
 private void ShowColorDialog(object sender, RoutedEventArgs eventArgs)
 {
     var colorDialog = new ColorDialog();
     colorDialog.ShowDialog();
 }
Exemple #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;
        }