Пример #1
0
        private static void OnSelectedColorPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ColorComboBox colorComboBox = d as ColorComboBox;

            if (colorComboBox.m_withinChange)
            {
                return;
            }

            colorComboBox.m_withinChange = true;
            if (colorComboBox.m_colorPicker != null)
            {
                colorComboBox.m_colorPicker.SelectedColor = colorComboBox.SelectedColor;
            }
            colorComboBox.m_withinChange = false;
        }
Пример #2
0
        private static void OnColorPickerSelectedColorChanged(object sender, RoutedPropertyChangedEventArgs <Color> e)
        {
            ColorComboBox colorComboBox = sender as ColorComboBox;

            if (colorComboBox.m_withinChange)
            {
                return;
            }

            colorComboBox.m_withinChange = true;
            if (colorComboBox.m_colorPicker != null)
            {
                colorComboBox.SelectedColor = colorComboBox.m_colorPicker.SelectedColor;
            }
            colorComboBox.m_withinChange = false;
        }
Пример #3
0
        private static void OnIsDropDownOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ColorComboBox colorComboBox = d as ColorComboBox;
            bool          newValue      = (bool)e.NewValue;

            // Mask HistTest visibility of toggle button otherwise when pressing it
            // and popup is open the popup is closed (since StaysOpen is false)
            // and reopens immediately
            if (colorComboBox.m_toggleButton != null)
            {
                colorComboBox.Dispatcher.BeginInvoke(
                    System.Windows.Threading.DispatcherPriority.Normal,
                    new Action(
                        delegate()
                {
                    colorComboBox.m_toggleButton.IsHitTestVisible = !newValue;
                }
                        ));
            }
            //Console.WriteLine("OnIsDropDownOpenChanged - Popup Focused {0} {1}",
            //    colorComboBox.m_popup.IsFocused, colorComboBox.m_popup.IsKeyboardFocused);
        }