This project has moved. For the latest updates, please go here.

ColorPicker suggestions

Nov 9, 2010 at 7:18 AM


Current ColorPicker control has 2 problems:

1- Location of its popup is not correct. Try to load it with a simple Grid:

        <extToolkit:ColorPicker  />

It will show up in the bottom of the window. To fix this you can move the popup inside the Grid of ToggleButton.

2- It would be nice to implement OnHexadecimalStringPropertyChanged method as well:
        private static void OnHexadecimalStringPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
            if (e.NewValue == null) return;
            ColorPicker c = (ColorPicker)d;

        protected virtual void SetHexadecimalString(string newValue)
            CurrentColor = (Color)new ColorConverter().ConvertFrom(newValue);
            SetValue(CurrentColorProperty, CurrentColor);
            SetValue(SelectedColorProperty, CurrentColor);

Nov 9, 2010 at 2:29 PM

To be honest, the ColorPicker has been ignored lately.  It is incomplete and still need a lot of work.  But to address your concerns.

1. Placing the PopUp inside the Grid of the ToggleButton will not fix it.  The control behaves as expected.  The problem is that since the Grid does not have any row heights specified it will maximize any content inside of it, this being the ColorPicker.  It just appears that it doesn't work correctly because I have specfified a Height on the toggle button, which was a temporary fix for a display issue, but in fact the ColorPicker is taking up the entire content of the Grid and behaves correctly.  To test my theory just remove the height from the ToggleButton.   So to fix your display issue you must define a RowDefinition as follows:

<RowDefinition Height="Auto"/>

2. As mentioned before the ColorPicker has been ignored for some time now.  As you can see by looking in the source, there are quite a few proeprties that still need to be implemented the HexadecimalString.  I will start working on the color picker again as soon as I can.

Nov 10, 2010 at 9:43 PM
brianlagunas wrote:

2. ...  I will start working on the color picker again as soon as I can.

ah ok fine I take this also as an indirect answer for my colorpicker question :O