This topic describes how to identify and modify the selected color in the xamColorPicker™ control.
The following topics are prerequisites to understanding this topic:
This topic contains the following sections:
The following table summarizes the user interaction capabilities of the xamColorPicker control related to the color selection.
Use the xamColorPicker SelectedColor
property to get/set the currently selected color.
The following table maps the desired configuration to the property settings that manage it.
The screenshot below demonstrates how the xamColorPicker would look as a result of the following settings:
Following is the code that implements this example.
In XAML:
<ig:XamColorPicker SelectedColor="Blue" Height="30" Width="150" />
In C#:
var colorPicker = new XamColorPicker {SelectedColor = Colors.Blue, Height = 30, Width = 150};
In Visual Basic:
Dim colorPicker = New XamColorPicker() With
{
.SelectedColor = Colors.Blue,
.Height = 30,
.Width = 150
}
The SelectedColorChanged
event is fired when the selected color within the xamColorPicker is changed.
It is fired when a user clicks on a specific color in some of the xamColorPicker Palettes.
This event receives an argument of type SelectedColorChangedEventArgs that provides information about the new and previous selected color.
Use the xamColorPicker SelectedColorPreview
property to identify the color that is currently being hovered.
This property is updated every time a user hovers over a color from the Current Color Palette, the Derived Color Palette, the Recent Color Palette or the palette in the Advanced editor.
In case the user isn’t hovering over colors, the SelectedColorPreview
value is the same as the SelectedColor
value.
The following table maps the desired behavior to the property settings that manage it.
The following topics provide additional information related to this topic.