public void onButtonClicked(object sender, RoutedEventArgs e) { ColorPalette.currentColor = colorValue; colorValue = ColorPalette.currentColor; colorValue = ColorPalette.currentColor; //notify property change? }
public ColorButton(Brush bgColor, ColorPalette.Value value) { colorValue = value; this.Width = 90; this.Height = 90; this.Background = bgColor; this.BorderThickness = new Thickness(0); this.Click += new RoutedEventHandler(onButtonClicked); }
public ColorButtonCollection() { for (int i = (int)ColorPalette.Value.RED; i < ColorPalette.MAX_NUM; ++i) { ColorButton button = new ColorButton(ColorPalette.brush[(int)color], color); color = (ColorPalette.Value)((int)color + 1); buttons.Add(button); } }