private void ButtonDown(object sender, RoutedEventArgs e) { Console.WriteLine("ButtonDown"); Button myButton = sender as Button; Brush buttonDark = myButton.Background; Colorpicker colorPicker = new Colorpicker(buttonDark); myButton.Background = colorPicker.darker(); }//Button Down method ends here
private void mouse_leftdown(object sender, RoutedEventArgs e) { Console.WriteLine("Left"); Button myBorder = sender as Button; // myBorder is a Instance of Border Brush labelDark = myBorder.Background; Colorpicker colorPicker = new Colorpicker(labelDark); // Creating Objet Of ColorPicker myBorder.Background = colorPicker.darker(); //((Button)sender).Background = new SolidColorBrush(Color.FromRgb(10,10,10)); // ((Button)sender).Foreground = new SolidColorBrush(Color.FromRgb(0,0,0)); }