Пример #1
0
        private void MenuMouseUp(object sender, RoutedEventArgs e)
        {
            Console.WriteLine("MouseLeftUp");
            MenuItem    menuItem      = sender as MenuItem;
            Brush       menuItemColor = menuItem.Background;
            Colorpicker colorPicker   = new Colorpicker(menuItemColor);

            menuItem.Background = colorPicker.lighter();
        }
Пример #2
0
        private void ItemMouseUp(object sender, RoutedEventArgs e)
        {
            Console.WriteLine("MenuItem MouseUp");
            Rectangle   rect        = sender as Rectangle;
            Brush       itemColor   = rect.Fill;
            Colorpicker colorPicker = new Colorpicker(itemColor);

            rect.Fill = colorPicker.lighter();
        }
Пример #3
0
        }//Button Down method ends here

        private void ButtonUp(object sender, RoutedEventArgs e)
        {
            Console.WriteLine("Button Up");

            Button      myButton    = sender as Button;
            Brush       buttonDark  = myButton.Background;
            Colorpicker colorPicker = new Colorpicker(buttonDark);

            myButton.Background = colorPicker.lighter();
        }//ButtonUp method ends here
Пример #4
0
        private void CheckBoxMouseUp(object sender, RoutedEventArgs e)
        {
            CheckBox checkBox = sender as CheckBox;

            Console.WriteLine("Mouse Up CheckBox");

            Colorpicker colorPicker = new Colorpicker(checkBox.Background);

            checkBox.Background = colorPicker.lighter();
        }
Пример #5
0
        private void ButtonGroupMouseUp(object sender, RoutedEventArgs e)
        {
            //Creating the borderbrush..
            RadioButton border      = sender as RadioButton;
            ButtonGroup buttonGroup = VisualTreeHelper.GetParent(border) as ButtonGroup;

            for (int i = 0; i < buttonGroup.Children.Count; i++)
            {
                RadioButton child = VisualTreeHelper.GetChild(buttonGroup, i) as RadioButton;
                if (child.IsChecked == true)
                {
                    child.IsChecked = false;
                    Colorpicker colorPicker = new Colorpicker(child.Background);
                    child.Background = colorPicker.lighter();
                }
            }

            border.IsChecked = true;
        }
Пример #6
0
        private void RadioButtonUp(object sender, RoutedEventArgs e)
        {
            Console.WriteLine("In button up property");
            //Checking the IsChecked property....
            CustomPanel stackPanel         = sender as CustomPanel;
            Border      radioButtonEnable  = stackPanel.FindName("EnableButton") as Border;
            Border      radioButtonDisable = stackPanel.FindName("DisableButton") as Border;
            Border      radioButton;

            Boolean EnabledFlag = true;

            try
            {
                ContentPresenter myContent = e.Source as ContentPresenter;
                Console.WriteLine(myContent.Content);
                if ((String)myContent.Tag == "Disable")
                {
                    EnabledFlag = false;
                }
                else
                {
                    EnabledFlag = true;
                }
            }
            catch (Exception)
            {
                Border myBorder = e.Source as Border;
                if ((String)myBorder.Tag == "Disable")
                {
                    EnabledFlag = false;
                }
                else
                {
                    EnabledFlag = true;
                }
            }
            if (EnabledFlag)
            {
                radioButton = radioButtonEnable;
                Colorpicker colorPicker = new Colorpicker(radioButton.Background);
                radioButton.Background = colorPicker.lighter();
            }
            else
            {
                radioButton = radioButtonDisable;
                Colorpicker colorPicker = new Colorpicker(radioButton.Background);
                radioButton.Background = colorPicker.lighter();
            }
            Console.WriteLine("PrevCheck value is " + stackPanel.PrevCheck);
            if (stackPanel.PrevCheck)
            {
                if (EnabledFlag)
                {
                    Console.WriteLine("I am inside enabled flag background");
                    Colorpicker colorPicker = new Colorpicker(radioButtonDisable.Background);
                    radioButtonEnable.Background  = colorPicker.dark();
                    radioButtonDisable.Background = new SolidColorBrush(Color.FromRgb(219, 219, 224));
                    stackPanel.PrevCheck          = false;
                }
            }

            if (stackPanel.PrevCheck == false)
            {
                if (EnabledFlag == false)
                {
                    Console.WriteLine("I am inside disabled flag background");
                    Colorpicker colorPicker = new Colorpicker(radioButtonEnable.Background);
                    radioButtonDisable.Background = colorPicker.dark();
                    radioButtonEnable.Background  = new SolidColorBrush(Color.FromRgb(219, 219, 224));
                    stackPanel.PrevCheck          = true;
                }
            }
        }