Final-ish Silverlight Color Picker Utility
Seeing as how I’ve already spent far too much time on this little project, barring major problems with this control (please point them out!) this will probably be my last version of the control. My ADD is kicking in and I need to work on something else.
If you’re interested in having the compact version of this control as a gadget, you can find it here.
Download Source for Color Picker Control
Download dll for Color Picker Control
Download Source for Color Picker Implementation (seen below)
Using the color picker in Blend
To add this to your application, just add the DLL above to your application by right clicking on the References folder in your Silverlight app.
Find the DLL and bring it into the application.
Open up the asset library (the bottom of the tool bar on the far left) and go to “Custom Controls”. You should find the ColorPicker in there.
Now you can just draw the whole thing right into your application.
Easy as pie.
You can swap between an extended view and a compact view by changing the “IsCompact” property. Compact view is basically gadget sized and expanded view can be as big as the screen if you want it to be.
Whenever you change the color, the control fires off a “ColorChanged” event. I thought that would be valuable for dynamic interactions. Hopefully you can find some fun uses for it.
Designer WPF » Blog Archive » Color Picker In Action (In The Silverlight Particle Project):
[...] Updated Color Picker Utility Category: Silverlight, colorpicker | Comment (RSS) | Trackback [...]
5 December 2008, 9:45 amDesigner WPF » Blog Archive » Using a Color Picker Silverlight Control:
[...] Updated Color Picker Utility [...]
5 December 2008, 9:46 amDesigner WPF » Blog Archive » Silverlight Color Picker:
[...] Updated Color Picker Utility [...]
5 December 2008, 9:47 am2008 December 08 - Links for today « My (almost) Daily Links:
[...] Shapiro and his Final-ish Silverlight Color Picker Utility and How To Give a Silverlight 2 Gadget a Transparent Background and How To Write a Custom Event in [...]
7 December 2008, 10:56 pmphucnd:
Good! I like it!
8 January 2009, 10:48 pmThanks!
GEB:
I have a question regarding the color picker. If I set the SelectedColor property immediately after the control is loaded (my object already has a color assigned), it updates resultCanvas.background, but it does not actually show this selected color in the color canvas. Any way to change the color picker in a way that when the selectedColor is set by the calling application, it sets the resultCanvas.Background AND the color canvas to the same selected color?
3 February 2009, 6:18 pmAdam:
I’m having the same issue as GEB. Excellent component, just not sure how to wire it so I can set the color in code.
Also, when you type a color into the text box, it doesn’t update.
I’m going to look into all of this later, but those are my only two issues with this great component!
20 February 2009, 5:42 amgreattall1:
I’m having trouble databinding to the SelectedColor property as well. I’m using the control inside of a datagrid in a template column, and when I switch to the color picker i get a AG_PARSER_BAD_PROPERTY_VALUE error, even though it is being bound to a SolidColorBrush.
14 April 2009, 9:50 amGreg:
The control is working with WPF?
27 May 2009, 2:05 amRishi:
I was looking at your picker, I have couple of suggestions to make it better..
1. The color picker should be dealing with the Color Type and not SolidColorBrush
2. The SelectedColor property should be a Dependency property, to allow binding
3. The UI should also work backwards, as in when set a color the UI markers should set themselves up
Cheers
23 July 2009, 8:38 amRishi:
One more suggestion, it would perhaps be better to have it as a Custom Control rather than a User Control.
23 July 2009, 8:40 am