In This Article

ColorPicker Class

Represents a color picker control.

[TemplatePart(Name = "PART_Component1EditBox", Type = typeof(Int32EditBox))]
[TemplatePart(Name = "PART_Component2EditBox", Type = typeof(Int32EditBox))]
[TemplatePart(Name = "PART_Component3EditBox", Type = typeof(Int32EditBox))]
public class ColorPicker : PickerBase, DUCE.IResource, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IHaveResources, IQueryAmbient
Inheritance:
Object DispatcherObject DependencyObject Visual UIElement FrameworkElement Control PickerBase Object

Constructors

ColorPicker()

Initializes an instance of the ColorPicker class.

public ColorPicker()

Properties

A

Gets or sets the alpha transparency component (0 - 255) of the Value.

public int A { get; set; }

Property Value

Int32:

The alpha transparency component of the Value.

B

Gets or sets the RGB blue component (0 - 255) of the Value.

public int B { get; set; }

Property Value

Int32:

The RGB blue component of the Value.

Brightness

Gets or sets the HSB brightness component (0 - 1.0) of the Value.

public double Brightness { get; set; }

Property Value

Double:

The HSB brightness component (0 - 1.0) of the Value.

ComparisonValue

Gets or sets the comparison color.

public Color ComparisonValue { get; set; }

Property Value

Color:

The comparison color.

Component1SwatchBrush

Gets the Brush to render in the component 1 swatch.

public Brush Component1SwatchBrush { get; }

Property Value

Brush:

The Brush to render in the component 1 swatch.

Component2SwatchBrush

Gets the Brush to render in the component 2 swatch.

public Brush Component2SwatchBrush { get; }

Property Value

Brush:

The Brush to render in the component 2 swatch.

Component3SwatchBrush

Gets the Brush to render in the component 3 swatch.

public Brush Component3SwatchBrush { get; }

Property Value

Brush:

The Brush to render in the component 3 swatch.

DegreeInlineTemplate

Gets or sets the DataTemplate with inline content for a degree glyph.

public DataTemplate DegreeInlineTemplate { get; set; }

Property Value

DataTemplate:

The DataTemplate with inline content for a degree glyph.

G

Gets or sets the RGB green component (0 - 255) of the Value.

public int G { get; set; }

Property Value

Int32:

The RGB green component of the Value.

HasColorEditBox

Gets or sets whether an embedded ColorEditBox should appear in the picker for hex-based color entry.

public bool HasColorEditBox { get; set; }

Property Value

Boolean:

true if an embedded ColorEditBox should appear in the picker for hex-based color entry; otherwise, false. The default value is true.

Hue

Gets or sets the HSB hue component (0 - 359.00) of the Value.

public double Hue { get; set; }

Property Value

Double:

The HSB hue component (0 - 359.00) of the Value.

IsAlphaEnabled

Gets or sets whether the alpha channel (transparency) of the color value is enabled.

public bool IsAlphaEnabled { get; set; }

Property Value

Boolean:

true if the alpha channel (transparency) of the color value is enabled; otherwise, false. The default value is true.

Remarks

When disabled, no transparency is supported.

IsComparisonValueVisible

Gets or sets a value indicating whether the comparison value is visible.

public bool IsComparisonValueVisible { get; set; }

Property Value

Boolean:

true if the comparison value is visible; otherwise false. The default value is false.

IsEditable

Gets or sets a value indicating whether the edit box text areas within the control are editable.

public bool IsEditable { get; set; }

Property Value

Boolean:

true if the edit box text areas within the control are editable; otherwise false. The default value is true.

Remarks

When false, the edit boxes behave more like a ComboBox.

PercentInlineTemplate

Gets or sets the DataTemplate with inline content for a percent glyph.

public DataTemplate PercentInlineTemplate { get; set; }

Property Value

DataTemplate:

The DataTemplate with inline content for a percent glyph.

R

Gets or sets the RGB red component (0 - 255) of the Value.

public int R { get; set; }

Property Value

Int32:

The RGB red component of the Value.

Saturation

Gets or sets the HSB saturation component (0 - 1.0) of the Value.

public double Saturation { get; set; }

Property Value

Double:

The HSB saturation component (0 - 1.0) of the Value.

TextInputMode

Gets or sets the text input mode of the picker.

public ColorPickerTextInputMode TextInputMode { get; set; }

Property Value

ColorPickerTextInputMode:

The text input mode of the picker.

Value

Gets or sets the selected color.

public Color? Value { get; set; }

Property Value

Nullable<Color>:

The selected color.

Methods

OnApplyTemplate()

Invoked whenever application code or internal processes call ApplyTemplate.

public override void OnApplyTemplate()

Events

ValueChanged

Occurs after the Value property value changes.

public event EventHandler ValueChanged

Event Type

EventHandler

Fields

AProperty

Identifies the A dependency property. This field is read-only.

public static readonly DependencyProperty AProperty

BProperty

Identifies the B dependency property. This field is read-only.

public static readonly DependencyProperty BProperty

BrightnessProperty

Identifies the Brightness dependency property. This field is read-only.

public static readonly DependencyProperty BrightnessProperty

ComparisonValueProperty

Identifies the ComparisonValue dependency property. This field is read-only.

public static readonly DependencyProperty ComparisonValueProperty

Component1SwatchBrushProperty

Identifies the Component1SwatchBrush dependency property. This field is read-only.

public static readonly DependencyProperty Component1SwatchBrushProperty

Component2SwatchBrushProperty

Identifies the Component2SwatchBrush dependency property. This field is read-only.

public static readonly DependencyProperty Component2SwatchBrushProperty

Component3SwatchBrushProperty

Identifies the Component3SwatchBrush dependency property. This field is read-only.

public static readonly DependencyProperty Component3SwatchBrushProperty

DegreeInlineTemplateProperty

Identifies the DegreeInlineTemplate dependency property. This field is read-only.

public static readonly DependencyProperty DegreeInlineTemplateProperty

GProperty

Identifies the G dependency property. This field is read-only.

public static readonly DependencyProperty GProperty

HasColorEditBoxProperty

Identifies the HasColorEditBox dependency property. This field is read-only.

public static readonly DependencyProperty HasColorEditBoxProperty

HueProperty

Identifies the Hue dependency property. This field is read-only.

public static readonly DependencyProperty HueProperty

IsAlphaEnabledProperty

Identifies the IsAlphaEnabled dependency property. This field is read-only.

public static readonly DependencyProperty IsAlphaEnabledProperty

IsComparisonValueVisibleProperty

Identifies the IsComparisonValueVisible dependency property. This field is read-only.

public static readonly DependencyProperty IsComparisonValueVisibleProperty

IsEditableProperty

Identifies the IsEditable dependency property. This field is read-only.

public static readonly DependencyProperty IsEditableProperty

PercentInlineTemplateProperty

Identifies the PercentInlineTemplate dependency property. This field is read-only.

public static readonly DependencyProperty PercentInlineTemplateProperty

RProperty

Identifies the R dependency property. This field is read-only.

public static readonly DependencyProperty RProperty

SaturationProperty

Identifies the Saturation dependency property. This field is read-only.

public static readonly DependencyProperty SaturationProperty

TextInputModeProperty

Identifies the TextInputMode dependency property. This field is read-only.

public static readonly DependencyProperty TextInputModeProperty

ValueProperty

Identifies the Value dependency property. This field is read-only.

public static readonly DependencyProperty ValueProperty

Inherited Members

Extension Methods