Exemple #1
0
        private void reccolor_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            var rec          = (sender as Rectangle);
            var initialcolor = (rec.Fill as SolidColorBrush).Color;
            var window       = new SelectColorWindow(new List <byte>(
                                                         new byte[] { initialcolor.R, initialcolor.G, initialcolor.B, initialcolor.A }
                                                         ));

            window.Closed += (s, eve) =>
            {
                SelectColorWindow w = (SelectColorWindow)s;
                if (w.DialogResult == true)
                {
                    simplemarkersymbol.Color = w.Color;
                    var colorbrush = new SolidColorBrush
                    {
                        Color = new System.Windows.Media.Color
                        {
                            R = w.Color[0],
                            G = w.Color[1],
                            B = w.Color[2],
                            A = w.Color[3]
                        }
                    };
                    rec.Fill = colorbrush;
                    UpdateJson();
                }
            };
            window.Show();
        }
 private void ColorButton_Click(object sender, RoutedEventArgs e)
 {
     SelectColorWindow dialog = new SelectColorWindow();
     dialog.Owner = this;
     dialog.Show();
 }