extended wpf toolkit color picker SelectedColorText

Sep 11, 2011 at 11:33 AM

hi All,

i am using this colorpicker. as explained here:

http://wpftoolkit.codeplex.com/discussions/234350?ProjectName=wpftoolkit

i want to bound it to the property defined in the Viewmodel:

 

 <extToolkit:ColorPicker 

           SelectedColor="{Binding Path=SelectedColor, Mode=TwoWay, Converter={StaticResource ColorToBrushConverter}}" >

 

 

public  Color SelectedColor

        {

            get { return _selectedColor; }

            set { _selectedColor = value;

            base.OnPropertyChanged("SelectedColor");

            }

        }

 

but when i change color it is not hitting the Set part of the SelectedColor property. am i missing something to bind it to the Property in the view model? it is going to the Converter properly but not the set part of the Selectedcolor property which it is bound to.

 

Second thing:is SelectedColorText property  not available ? i am not getting it in XAMl tag. like i got the SelectedColor property.

 

Thanks in advance for help.

 

-Kamlendra

Sep 11, 2011 at 3:19 PM

You don't need a converter since your property is of type Color.  Just remove it from your binding.  Also, the SelectedColorText cannot be set it is read only.

Sep 13, 2011 at 5:12 AM

thanks Brian :).

Sep 13, 2011 at 7:44 AM
Edited Sep 13, 2011 at 8:29 AM

thanks Brian :).