SpectrumColorPicker Class
Represents a hue spectrum color picker control.
[TemplatePart(Name = "PART_Slice", Type = typeof(SpectrumSlice))]
[TemplatePart(Name = "PART_Slider", Type = typeof(SpectrumSlider))]
public class SpectrumColorPicker : Control
- Inheritance:
- object Visual UIElement FrameworkElement Control object
Constructors
SpectrumColorPicker()
Initializes an instance of the class.
public SpectrumColorPicker()
Properties
A
The ARGB alpha component of the SelectedColor.
B
The RGB blue component of the SelectedColor.
DisabledOpacity
The opacity used when the control is disabled.
G
The RGB green component of the SelectedColor.
InitialColor
The Color that was initially selected in the picker.
InitialColorBrush
A Brush that uses the InitialColor.
IsColorSwatchRowVisible
Indicates whether the color swatch row is visible in the color picker.
public bool IsColorSwatchRowVisible { get; set; }
Property Value
- bool:
trueif the color swatch row is visible in the color picker; otherwise,false. The default value istrue.
IsInitialColorVisible
Indicates whether the initial color swatch is visible in the color picker.
public bool IsInitialColorVisible { get; set; }
Property Value
- bool:
trueif the initial color swatch is visible in the color picker; otherwise,false. The default value istrue.
R
The RGB red component of the SelectedColor.
SelectedColor
The Color that is selected in the picker.
SelectedColorBrush
A Brush that uses the SelectedColor.
SetColor
The ICommand for setting a color.
Methods
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().
public override void OnApplyTemplate()
OnSelectedColorChanged(Color, Color)
Raises the SelectedColorChanged event.
protected virtual void OnSelectedColorChanged(Color oldValue, Color newValue)
| Parameter | Type | Description |
|---|---|---|
| oldValue | Color | The old value. |
| newValue | Color | The new value. |
Events
SelectedColorChanged
Occurs when the value of the SelectedColor property is changed.
public event RoutedPropertyChangedEventHandler<Color> SelectedColorChanged
Event Type
Fields
AProperty
Defines the A property.
public static readonly DependencyProperty AProperty
BProperty
Defines the B property.
public static readonly DependencyProperty BProperty
DisabledOpacityProperty
Defines the DisabledOpacity property.
public static readonly DependencyProperty DisabledOpacityProperty
GProperty
Defines the G property.
public static readonly DependencyProperty GProperty
InitialColorBrushProperty
Defines the InitialColorBrush property.
public static readonly DependencyProperty InitialColorBrushProperty
InitialColorProperty
Defines the InitialColor property.
public static readonly DependencyProperty InitialColorProperty
IsColorSwatchRowVisibleProperty
Defines the IsColorSwatchRowVisible property.
public static readonly DependencyProperty IsColorSwatchRowVisibleProperty
IsInitialColorVisibleProperty
Defines the IsInitialColorVisible property.
public static readonly DependencyProperty IsInitialColorVisibleProperty
RProperty
Defines the R property.
public static readonly DependencyProperty RProperty
SelectedColorBrushProperty
Defines the SelectedColorBrush property.
public static readonly DependencyProperty SelectedColorBrushProperty
SelectedColorChangedEvent
Defines the SelectedColorChanged event.
public static readonly RoutedEvent SelectedColorChangedEvent
SelectedColorProperty
Defines the SelectedColor property.
public static readonly DependencyProperty SelectedColorProperty