In This Article

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.

public byte A { get; set; }

Property Value

byte

B

The RGB blue component of the SelectedColor.

public byte B { get; set; }

Property Value

byte

DisabledOpacity

The opacity used when the control is disabled.

public double DisabledOpacity { get; set; }

Property Value

double

G

The RGB green component of the SelectedColor.

public byte G { get; set; }

Property Value

byte

InitialColor

The Color that was initially selected in the picker.

public Color InitialColor { get; set; }

Property Value

Color

InitialColorBrush

A Brush that uses the InitialColor.

public Brush InitialColorBrush { get; }

Property Value

Brush

IsColorSwatchRowVisible

Indicates whether the color swatch row is visible in the color picker.

public bool IsColorSwatchRowVisible { get; set; }

Property Value

bool:

true if the color swatch row is visible in the color picker; otherwise, false. The default value is true.

IsInitialColorVisible

Indicates whether the initial color swatch is visible in the color picker.

public bool IsInitialColorVisible { get; set; }

Property Value

bool:

true if the initial color swatch is visible in the color picker; otherwise, false. The default value is true.

R

The RGB red component of the SelectedColor.

public byte R { get; set; }

Property Value

byte

SelectedColor

The Color that is selected in the picker.

public Color SelectedColor { get; set; }

Property Value

Color

SelectedColorBrush

A Brush that uses the SelectedColor.

public Brush SelectedColorBrush { get; }

Property Value

Brush

SetColor

The ICommand for setting a color.

public static ICommand SetColor { get; }

Property Value

ICommand

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

RoutedPropertyChangedEventHandler<Color>

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

Extension Methods