This project has moved and is read-only. For the latest updates, please go here.

ColorPicker suggestions

Nov 9, 2010 at 8:18 AM

Hello,

Current ColorPicker control has 2 problems:


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

<Grid>
        <extToolkit:ColorPicker  />
</Grid>


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;
            c.SetHexadecimalString(e.NewValue.ToString());
        }

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


Nov 9, 2010 at 3: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:

<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>

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 10: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