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
- Inheritance:
- object Visual UIElement FrameworkElement Control PickerBase object
Constructors
ColorPicker()
Initializes an instance of the class.
public ColorPicker()
Properties
A
The alpha transparency component (0 - 255) of the Value.
B
The RGB blue component (0 - 255) of the Value.
Brightness
The HSB brightness component (0 - 1.0) of the Value.
ComparisonValue
The comparison color.
Component1SwatchBrush
The Brush to render in the component 1 swatch.
Component2SwatchBrush
The Brush to render in the component 2 swatch.
Component3SwatchBrush
The Brush to render in the component 3 swatch.
DegreeInlineTemplate
The DataTemplate with inline content for a degree glyph.
G
The RGB green component (0 - 255) of the Value.
HasColorEditBox
Indicates whether an embedded ColorEditBox should appear in the picker for hex-based color entry.
public bool HasColorEditBox { get; set; }
Property Value
- bool:
trueif an embedded ColorEditBox should appear in the picker for hex-based color entry; otherwise,false. The default value istrue.
Hue
The HSB hue component (0 - 359.00) of the Value.
IsAlphaEnabled
Indicates whether the alpha channel (transparency) of the color value is enabled.
public bool IsAlphaEnabled { get; set; }
Property Value
- bool:
trueif the alpha channel (transparency) of the color value is enabled; otherwise,false. The default value istrue.
Remarks
When disabled, no transparency is supported.
IsComparisonValueVisible
Indicates whether the comparison value is visible.
public bool IsComparisonValueVisible { get; set; }
Property Value
- bool:
trueif the comparison value is visible; otherwisefalse. The default value isfalse.
IsEditable
Indicates whether the edit box text areas within the control are editable.
public bool IsEditable { get; set; }
Property Value
- bool:
trueif the edit box text areas within the control are editable; otherwisefalse. The default value istrue.
Remarks
When false, the edit boxes behave more like a ComboBox.
PercentInlineTemplate
The DataTemplate with inline content for a percent glyph.
R
The RGB red component (0 - 255) of the Value.
Saturation
The HSB saturation component (0 - 1.0) of the Value.
TextInputMode
The text input mode of the picker.
Value
The selected color.
Methods
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().
public override void OnApplyTemplate()
Events
ValueChanged
Occurs after the Value property value changes.
Fields
AProperty
Defines the A property.
public static readonly DependencyProperty AProperty
BProperty
Defines the B property.
public static readonly DependencyProperty BProperty
BrightnessProperty
Defines the Brightness property.
public static readonly DependencyProperty BrightnessProperty
ComparisonValueProperty
Defines the ComparisonValue property.
public static readonly DependencyProperty ComparisonValueProperty
Component1SwatchBrushProperty
Defines the Component1SwatchBrush property.
public static readonly DependencyProperty Component1SwatchBrushProperty
Component2SwatchBrushProperty
Defines the Component2SwatchBrush property.
public static readonly DependencyProperty Component2SwatchBrushProperty
Component3SwatchBrushProperty
Defines the Component3SwatchBrush property.
public static readonly DependencyProperty Component3SwatchBrushProperty
DegreeInlineTemplateProperty
Defines the DegreeInlineTemplate property.
public static readonly DependencyProperty DegreeInlineTemplateProperty
GProperty
Defines the G property.
public static readonly DependencyProperty GProperty
HasColorEditBoxProperty
Defines the HasColorEditBox property.
public static readonly DependencyProperty HasColorEditBoxProperty
HueProperty
Defines the Hue property.
public static readonly DependencyProperty HueProperty
IsAlphaEnabledProperty
Defines the IsAlphaEnabled property.
public static readonly DependencyProperty IsAlphaEnabledProperty
IsComparisonValueVisibleProperty
Defines the IsComparisonValueVisible property.
public static readonly DependencyProperty IsComparisonValueVisibleProperty
IsEditableProperty
Defines the IsEditable property.
public static readonly DependencyProperty IsEditableProperty
PercentInlineTemplateProperty
Defines the PercentInlineTemplate property.
public static readonly DependencyProperty PercentInlineTemplateProperty
RProperty
Defines the R property.
public static readonly DependencyProperty RProperty
SaturationProperty
Defines the Saturation property.
public static readonly DependencyProperty SaturationProperty
TextInputModeProperty
Defines the TextInputMode property.
public static readonly DependencyProperty TextInputModeProperty
ValueProperty
Defines the Value property.
public static readonly DependencyProperty ValueProperty