Class ColorEdit
Represents a control that helps to edit and manage color data.
Inheritance
Implements
Namespace: Syncfusion.Windows.Shared
Assembly: Syncfusion.Shared.WPF.dll
Syntax
[SkinType]
[SkinType]
[SkinType]
[SkinType]
[SkinType]
[SkinType]
[SkinType]
[SkinType]
[SkinType]
[SkinType]
[SkinType]
[SkinType]
[SkinType]
[SkinType]
[SkinType]
public class ColorEdit : Control, IDisposable
Constructors
ColorEdit()
Initializes a new instance of the ColorEdit class.
Declaration
public ColorEdit()
Fields
AProperty
Identifies A dependency property.
Declaration
public static readonly DependencyProperty AProperty
Field Value
Type | Description |
---|---|
System.Windows.DependencyProperty | Type: System.Single |
BackgroundAProperty
Identifies BackgroundA dependency property.
Declaration
public static readonly DependencyProperty BackgroundAProperty
Field Value
Type | Description |
---|---|
System.Windows.DependencyProperty | Type: Brush |
BackgroundBProperty
Identifies BackgroundB dependency property.
Declaration
public static readonly DependencyProperty BackgroundBProperty
Field Value
Type | Description |
---|---|
System.Windows.DependencyProperty | Type: Brush |
BackgroundGProperty
Identifies BackgroundG dependency property.
Declaration
public static readonly DependencyProperty BackgroundGProperty
Field Value
Type | Description |
---|---|
System.Windows.DependencyProperty | Type: Brush |
BackgroundRProperty
Identifies BackgroundR dependency property.
Declaration
public static readonly DependencyProperty BackgroundRProperty
Field Value
Type | Description |
---|---|
System.Windows.DependencyProperty | Type: Brush |
BProperty
Identifies B dependency property.
Declaration
public static readonly DependencyProperty BProperty
Field Value
Type | Description |
---|---|
System.Windows.DependencyProperty | Type: System.Single |
BrushModeProperty
Identifies BrushMode dependency property.
Declaration
public static readonly DependencyProperty BrushModeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
BrushProperty
Identifies Brush dependency property.
Declaration
public static readonly DependencyProperty BrushProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
CentrePointProperty
Identifies CentrePoint dependency property.
Declaration
public static readonly DependencyProperty CentrePointProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
ColorProperty
Identifies Color dependency property.
Declaration
public static readonly DependencyProperty ColorProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
EnableGradientToSolidSwitchProperty
Identifies EnableGradientToSolidSwitch dependency property.
Declaration
public static readonly DependencyProperty EnableGradientToSolidSwitchProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
EnableToolTipProperty
Identifies EnableToolTip dependency property.
Declaration
public static readonly DependencyProperty EnableToolTipProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
EndpointProperty
Identifies Endpoint dependency property.
Declaration
public static readonly DependencyProperty EndpointProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
GProperty
Identifies G dependency property.
Declaration
public static readonly DependencyProperty GProperty
Field Value
Type | Description |
---|---|
System.Windows.DependencyProperty | Type: System.Single |
GradientOriginProperty
Identifies GradientOrigin dependency property.
Declaration
public static readonly DependencyProperty GradientOriginProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
GradientPropertyEditorModeProperty
Identifies GradientPropertyEditorMode dependency property.
Declaration
public static readonly DependencyProperty GradientPropertyEditorModeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
HSVProperty
Identifies HSV dependency property.
Declaration
public static readonly DependencyProperty HSVProperty
Field Value
Type | Description |
---|---|
System.Windows.DependencyProperty | Type: HSV enum. |
IsAlphaVisibleProperty
Identifies IsAlphaVisible dependency property.
Declaration
public static readonly DependencyProperty IsAlphaVisibleProperty
Field Value
Type | Description |
---|---|
System.Windows.DependencyProperty | Type: System.Boolean |
IsCenterVisibleProperty
Identifies ColorPicker.IsCenterVisible dependency property.
Declaration
public static readonly DependencyProperty IsCenterVisibleProperty
Field Value
Type | Description |
---|---|
System.Windows.DependencyProperty | Type: System.Boolean |
IsGradientOriginVisibleProperty
Identifies ColorPicker.IsGradientOriginVisible dependency property.
Declaration
public static readonly DependencyProperty IsGradientOriginVisibleProperty
Field Value
Type | Description |
---|---|
System.Windows.DependencyProperty | Type: System.Boolean |
IsGradientPropertyEnabledProperty
Identifies IsGradientPropertyEnabled dependency property.
Declaration
public static readonly DependencyProperty IsGradientPropertyEnabledProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IsOpenGradientPropertyEditorProperty
Identifies IsOpenGradientPropertyEditor dependency property.
Declaration
public static readonly DependencyProperty IsOpenGradientPropertyEditorProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IsRadiusVisibleProperty
Identifies ColorPicker.IsRadiusVisible dependency property.
Declaration
public static readonly DependencyProperty IsRadiusVisibleProperty
Field Value
Type | Description |
---|---|
System.Windows.DependencyProperty | Type: System.Boolean |
IsScRGBColorProperty
Identifies IsScRGBColor dependency property.
Declaration
public static readonly DependencyProperty IsScRGBColorProperty
Field Value
Type | Description |
---|---|
System.Windows.DependencyProperty | Type: System.Boolean |
M_changeColorBlack
Command for black color change. RGB model.
Declaration
public static RoutedCommand M_changeColorBlack
Field Value
Type |
---|
System.Windows.Input.RoutedCommand |
M_changeColorWhite
Command for white color change. RGB model.
Declaration
public static RoutedCommand M_changeColorWhite
Field Value
Type |
---|
System.Windows.Input.RoutedCommand |
RadiusXProperty
Identifies RadiusX dependency property.
Declaration
public static readonly DependencyProperty RadiusXProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
RadiusYProperty
Identifies RadiusY dependency property.
Declaration
public static readonly DependencyProperty RadiusYProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
RProperty
Identifies R dependency property.
Declaration
public static readonly DependencyProperty RProperty
Field Value
Type | Description |
---|---|
System.Windows.DependencyProperty | Type: System.Single |
StartpointProperty
Identifies Startpoint dependency property.
Declaration
public static readonly DependencyProperty StartpointProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
ThumbTemplateProperty
Identifies ThumbTemplate dependency property.
Declaration
public static readonly DependencyProperty ThumbTemplateProperty
Field Value
Type | Description |
---|---|
System.Windows.DependencyProperty | Type: Color |
Properties
A
Gets or sets the Alpha or opacity parameter.
Declaration
public float A { get; set; }
Property Value
Type | Description |
---|---|
System.Single | Type: System.Single Alpha. |
B
Gets or sets the Blue parameter for RGB selection mode.
Declaration
public float B { get; set; }
Property Value
Type | Description |
---|---|
System.Single | Type: System.Single Blue. |
BackgroundA
Gets or sets the background of Alpha slider.
Declaration
public Brush BackgroundA { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.Brush | Type: Brush The background Alpha. |
BackgroundB
Gets or sets the background of Blue slider for RGB selection mode.
Declaration
public Brush BackgroundB { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.Brush | Type: Brush The background Blue. |
BackgroundG
Gets or sets the background of Green slider for RGB selection mode.
Declaration
public Brush BackgroundG { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.Brush | Type: Brush The background Green. |
BackgroundR
Gets or sets the background of Red slider for RGB selection mode.
Declaration
public Brush BackgroundR { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.Brush | Type: Brush The background Red. |
Brush
Gets or sets a value which comprises selected brush of ColorEdit.
Declaration
public Brush Brush { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.Brush | The brush. |
BrushMode
Gets or sets the mode of the Brush property.
Declaration
public BrushModes BrushMode { get; set; }
Property Value
Type | Description |
---|---|
BrushModes | The brush mode. |
CentrePoint
Gets or sets the CentrePoint of the selected brush if it is radial gradient.
Declaration
public Point CentrePoint { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Point | The CentrePoint. |
Color
Gets or sets a value detemines the selected color of the ColorEdit.
Declaration
public Color Color { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.Color | Type: Color |
EnableGradientToSolidSwitch
Gets or sets a value indicating whether gradient to solid switchis enabled.
Declaration
public bool EnableGradientToSolidSwitch { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
EnableToolTip
Gets or sets a value indicating whether to show tooltip or not.
Declaration
public bool EnableToolTip { get; set; }
Property Value
Type |
---|
System.Boolean |
Endpoint
Gets or sets the Endpoint of the selected brush if it is linear gradient.
Declaration
public Point Endpoint { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Point | The endpoint. |
G
Gets or sets the Green parameter for RGB selection mode.
Declaration
public float G { get; set; }
Property Value
Type | Description |
---|---|
System.Single | Type: System.Single Green. |
GradientOrigin
Gets or sets the GradientOrigin of the selected brush if it is Radial gradient.
Declaration
public Point GradientOrigin { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Point | The gradient origin. |
GradientPropertyEditorMode
Gets or sets the mode in which the gradient property editor will open.
Declaration
public GradientPropertyEditorMode GradientPropertyEditorMode { get; set; }
Property Value
Type | Description |
---|---|
GradientPropertyEditorMode | The gradient property editor mode. |
H
Gets or sets the Hue parameter for HSV selection mode.
Declaration
public float H { get; set; }
Property Value
Type | Description |
---|---|
System.Single | Type: System.Single Hue. |
HSV
Gets or sets the parameter selected for HSV visualization.
Declaration
public HSV HSV { get; set; }
Property Value
Type | Description |
---|---|
HSV | Type: HSV enum. The HSV. |
InvertColor
Gets or sets a color value that is exactly the contrast of the Color.
Declaration
public Color InvertColor { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.Color | Type: Color |
IsAlphaVisible
Gets or sets a value that indicates whether the Alpha editor is visible.
Declaration
public bool IsAlphaVisible { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Type: System.Boolean |
IsCenterVisible
?
Gets or sets a value indicating whether the input box for the center of a radial gradient color is visible.
Declaration
public bool IsCenterVisible { get; set; }
Property Value
Type |
---|
System.Boolean |
IsGradientOriginVisible
?
Gets or sets a value indicating whether the input box for the gradient origin of a radial gradient color is visible.
Declaration
public bool IsGradientOriginVisible { get; set; }
Property Value
Type |
---|
System.Boolean |
IsGradientPropertyEnabled
Gets or sets a value indicating whether to enable gradient property or not.
Declaration
public bool IsGradientPropertyEnabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
IsOpenGradientPropertyEditor
Gets or sets a value indicating whether to open gradient property editor or not.
Declaration
public bool IsOpenGradientPropertyEditor { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
IsRadiusVisible
?
Gets or sets a value indicating whether the input box for the radius of a radial gradient color is visible.
Declaration
public bool IsRadiusVisible { get; set; }
Property Value
Type |
---|
System.Boolean |
IsScRGBColor
Gets or sets a value indicating whether this instance is ScRGB color.
Declaration
public bool IsScRGBColor { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Type: System.Boolean True, if this instance is Sc RGB color; otherwise, false. |
R
Gets or sets the Red parameter for RGB selection mode.
Declaration
public float R { get; set; }
Property Value
Type | Description |
---|---|
System.Single | Type: System.Single Red. |
RadiusX
Gets or sets the RadiusX of the selected brush if it is Radial gradient.
Declaration
public Point RadiusX { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Point | The radius X. |
RadiusY
Gets or sets the RadiusY of the selected brush if it is Radial gradient.
Declaration
public Point RadiusY { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Point | The radius Y. |
S
Gets or sets the Saturation parameter for HSV selection mode.
Declaration
public float S { get; set; }
Property Value
Type | Description |
---|---|
System.Single | Type: System.Single Saturation. |
Startpoint
Gets or sets the startpoint of the selected brush if it is linear gradient.
Declaration
public Point Startpoint { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Point | The startpoint. |
ThumbTemplate
Gets or sets the control template used to display the thumb in gradient editor.
Declaration
public ControlTemplate ThumbTemplate { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Controls.ControlTemplate | The thumb template. |
V
Gets or sets the Value or Brightness parameter for HSV selection model.
Declaration
public float V { get; set; }
Property Value
Type | Description |
---|---|
System.Single | Type: System.Single Value. |
VisualizationStyle
Gets or sets a value to determine the Color Selection mode.
Declaration
public ColorSelectionMode VisualizationStyle { get; set; }
Property Value
Type | Description |
---|---|
ColorSelectionMode | Type: ColorSelectionMode |
Methods
CalculateHSVBackground()
Calculates the background of H,S and V sliders with respective to selected color.
Declaration
public void CalculateHSVBackground()
Dispose()
Disposes all the resources.
Declaration
public void Dispose()
OnApplyTemplate()
When implemented in a derived class, will be invoked whenever application code or internal processes call System.Windows.FrameworkElement.ApplyTemplate.
Declaration
public override void OnApplyTemplate()
OnKeyDown(KeyEventArgs)
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.KeyEventArgs | e |
OnLostFocus(RoutedEventArgs)
Called on Lost Focus
Declaration
protected override void OnLostFocus(RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.RoutedEventArgs | e |
OnMouseLeftButtonDown(MouseButtonEventArgs)
Invoked when an unhandled System.Windows.UIElement.MouseLeftButtonDownrouted event is raised on this element. This method implements to add class handling for this event.
Declaration
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseButtonEventArgs | e | The System.Windows.Input.MouseButtonEventArgsthat contains the event data. The event data reports that the left mouse button was pressed. |
OnMouseLeftButtonUp(MouseButtonEventArgs)
Invoked when an unhandled System.Windows.UIElement.MouseLeftButtonUprouted event reaches an element in its route that is derived from this class. Implements this method to add class handling for this event.
Declaration
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseButtonEventArgs | e | The System.Windows.Input.MouseButtonEventArgsthat contains the event data. The event data reports that the left mouse button was released. |
OnPropertyChanged(DependencyPropertyChangedEventArgs)
Invoked whenever the effective value of any dependency property on this System.Windows.FrameworkElement has been updated. The specific dependency property that changed is reported in the arguments parameter. Overrides System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs).
Declaration
protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | The event data that describes the property that changed, as well as old and new values. |
SuchColor(Color)
Returns an array of closest
Declaration
public static string[] SuchColor(Color color)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Media.Color | color | Identification color. |
Returns
Type | Description |
---|---|
System.String[] | Array of known or similar colors. |
Events
AChanged
Occurs when A property is changed.
Declaration
public event PropertyChangedCallback AChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
BChanged
Occurs when B property is changed.
Declaration
public event PropertyChangedCallback BChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
ColorChanged
Occurs when Color property is changed.
Declaration
public event PropertyChangedCallback ColorChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
EnableToolTipChanged
Occurs when EnableToolTip property is changed.
Declaration
public event PropertyChangedCallback EnableToolTipChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
GChanged
Occurs when G property is changed.
Declaration
public event PropertyChangedCallback GChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
GradientPropertyEditorModeChanged
Occurs when GradientPropertyEditorMode property is changed.
Declaration
public event PropertyChangedCallback GradientPropertyEditorModeChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
HChanged
Occurs when H property is changed.
Declaration
public event PropertyChangedCallback HChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
IsGradientPropertyEnabledChanged
Occurs when IsGradientPropertyEnabled property is changed.
Declaration
public event PropertyChangedCallback IsGradientPropertyEnabledChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
IsOpenGradientPropertyEditorChanged
Occurs when IsOpenGradientPropertyEditor property is changed.
Declaration
public event PropertyChangedCallback IsOpenGradientPropertyEditorChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
RChanged
Occurs when R property is changed.
Declaration
public event PropertyChangedCallback RChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
SChanged
Occurs when S property is changed.
Declaration
public event PropertyChangedCallback SChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
SliderValueHSVChanged
Occurs when Syncfusion.Windows.Shared.ColorEdit.SliderValueHSV property is changed.
Declaration
public event PropertyChangedCallback SliderValueHSVChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
VChanged
Occurs when V property is changed.
Declaration
public event PropertyChangedCallback VChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
VisualizationStyleChanged
Occurs when VisualizationStyle property is changed.
Declaration
public event PropertyChangedCallback VisualizationStyleChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |