Exemple #1
0
        private void ColorPalette_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            ColorPaletteDlg dlg = new ColorPaletteDlg();

            if (ShowVMSDlg(dlg))
            {
                GeneratePanels();
            }
        }
 public ColorPaletteStackItem(ColorPalette colorPalette, ColorPaletteDlg parent)
     : base()
 {
     NormalBackground      = new SolidColorBrush(Colors.White);
     HighlightedBackground = new SolidColorBrush(Colors.LightBlue);
     Orientation           = Orientation.Horizontal;
     this.colorPalette     = colorPalette;
     IsSelected            = false;
     Title = new TextBlock()
     {
         Text         = colorPalette.PaletteName,
         Width        = 200,
         TextWrapping = TextWrapping.Wrap,
     };
     Children.Add(Title);
     MainBackground = new Rectangle()
     {
         Fill = new SolidColorBrush(colorPalette.MainBackground)
     };
     GaugeBackground = new Rectangle()
     {
         Fill = new SolidColorBrush(colorPalette.GaugeBackground)
     };
     Captions = new Rectangle()
     {
         Fill = new SolidColorBrush(colorPalette.Captions)
     };
     GaugeText = new Rectangle()
     {
         Fill = new SolidColorBrush(colorPalette.GaugeText)
     };
     Green = new Rectangle()
     {
         Fill = new SolidColorBrush(colorPalette.Green)
     };
     Yellow = new Rectangle()
     {
         Fill = new SolidColorBrush(colorPalette.Yellow)
     };
     Red = new Rectangle()
     {
         Fill = new SolidColorBrush(colorPalette.Red)
     };
     this.parent = parent;
     AddColorRect(MainBackground);
     AddColorRect(GaugeBackground);
     AddColorRect(Captions);
     AddColorRect(GaugeText);
     AddColorRect(Green);
     AddColorRect(Yellow);
     AddColorRect(Red);
     ContextMenu //= new ContextMenu();
     //ContextMenu.ContextMenu
         = CreateContextMenu();
     MouseLeftButtonUp += ColorPaletteStackItem_MouseLeftButtonUp;
 }