ColorPicker
The ColorPicker control allows users to select a color from a standard palette of named colors, or by choosing RGB values using sliders.
Optionally, you can also provide your own color palette, similar to the color palettes in Microsoft Office applications. See the StandardPalettes class for built-in palettes or create your own. If you create your own, it should be a list of ColorPickerItem objects. The default display expects this list to be arranged as follows:
- 10 “theme” colors.
- For each “theme” color, 5 variants of that color. Each block of variants must be contiguous and the blocks must appear in the same order as the “theme” colors. For example, elements 10-14 of the list would be the variants on theme color 0, elements 15-19 the variants of theme color 1, etc.
- 10 “standard” colors.

<UserControl.Resources> <ms:ColorToSolidColorBrushConverter x:Key="scb" /> </UserControl.Resources> <StackPanel> <ms:ColorPicker Name="cp" /> <Border Width="40" Height="40" Background="{Binding SelectedColor, ElementName=cp, Converter={StaticResource scb}}" /> </StackPanel>
PaletteColorPicker
The PaletteColorPicker restricts the user to selecting from a specific palette which you provide. The rules for constructing this palette are the same as for the ColorPicker, except that the list must contain an additional “automatic” color as the first element, i.e.
- 1 “automatic” color.
- 10 “theme” colors.
- For each “theme” color, 5 variants of that color (as above).
- 10 “standard” colors.

<ms:PaletteColorPicker SelectedColor="AliceBlue" />To customise the display of the collapsed part of the PaletteColorPicker, for example to provide a legend or visual hint as to what is affected by the selection, use the CollapsedViewTemplate property. The specified template will be bound to a ColorPickerItem representing the current selection.

<UserControl.Resources> <ms:ColorToSolidColorBrushConverter x:Key="scb" /> </UserControl.Resources> <ms:PaletteColorPicker SelectedColor="DarkRed"> <ms:PaletteColorPicker.CollapsedViewTemplate> <DataTemplate> <Border Width="28" Height="20"> <TextBlock Text="A" TextAlignment="Center" FontSize="16" FontWeight="Bold" Foreground="{Binding Color, Converter={StaticResource scb}}" /> </Border> </DataTemplate> </ms:PaletteColorPicker.CollapsedViewTemplate> </ms:PaletteColorPicker>