This element is the one more control from the ColorPicker constituent controls bug in addition to the published in my recent posts.
KnownColorPicker control is designed as the tool to select the Color from the set of predefined colors. It’s the very simple User Control and is developed as the separate entity to encapsulate the predefined color sets initialization code and ListBox and ComboBox controls templates.
KnownColorPicker control has two sets of predefined colors. The first one contains 64 colors which we can see in the Windows Common Color Dialog. This set is labeled as "Base Colors" and is presented in the ListBox at the top. The second one contains all the colors defined in the Windows.System.Windows.Media.Colors class. This set is labeled as "All WellKnown Colors" and is presented in the ComboBox at the bottom.
That is the sample:
At the figure above the Bisque border is given to the
KnownColorPicker control just to make it distinctive.
KnownColorPicker has the
SelectedColor Dependency Property used to get or set the value of the Color selected. When the
SelectedColor changes the
KnownColorPicker raises the
You can download the code and the samples here:
The archive contains my WPFGears library with samples, tests, etc. It’s the Visual Studio 2008 SP1 solution targeted to .NET Framework 3.5.
You’ll find KnownColorPickerSample project there.
KnownColorPicker control code is in the WPFGears library project ColorPickerControls folder.
Oleg V. Polikarpotchkin