SpectrumColorPicker Class
Represents a hue spectrum color picker control.
public class SpectrumColorPicker : Control, DUCE.IResource, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IHaveResources, IQueryAmbient
- Inheritance:
- System.Object System.Windows.Threading.DispatcherObject System.Windows.DependencyObject System.Windows.Media.Visual System.Windows.UIElement System.Windows.FrameworkElement System.Windows.Controls.Control Object
Remarks
For detailed documentation on this control's features and how to use them, please see the Shared Color Selection documentation topic.
Constructors
SpectrumColorPicker()
Initializes an instance of the SpectrumColorPicker
class.
public SpectrumColorPicker()
Properties
A
Gets or sets the ARGB alpha component of the SelectedColor.
public byte A { get; set; }
Property Value
- System.Byte:
The ARGB alpha component of the SelectedColor.
B
Gets or sets the RGB blue component of the SelectedColor.
public byte B { get; set; }
Property Value
- System.Byte:
The RGB blue component of the SelectedColor.
DisabledOpacity
Gets or sets the opacity used when the control is disabled.
public double DisabledOpacity { get; set; }
Property Value
- System.Double:
The opacity used when the control is disabled.
G
Gets or sets the RGB green component of the SelectedColor.
public byte G { get; set; }
Property Value
- System.Byte:
The RGB green component of the SelectedColor.
InitialColor
Gets or sets the System.Windows.Media.Color that was initially selected in the picker.
public Color InitialColor { get; set; }
Property Value
- System.Windows.Media.Color:
The System.Windows.Media.Color that was initially selected in the picker.
InitialColorBrush
Gets a System.Windows.Media.Brush that uses the InitialColor. This is a dependency property.
public Brush InitialColorBrush { get; }
Property Value
- System.Windows.Media.Brush:
A System.Windows.Media.Brush.
IsColorSwatchRowVisible
Gets or sets whether the color swatch row is visible in the color picker.
public bool IsColorSwatchRowVisible { get; set; }
Property Value
- System.Boolean:
true
if the color swatch row is visible in the color picker; otherwise,false
. The default value istrue
.
IsInitialColorVisible
Gets or sets whether the initial color swatch is visible in the color picker.
public bool IsInitialColorVisible { get; set; }
Property Value
- System.Boolean:
true
if the initial color swatch is visible in the color picker; otherwise,false
. The default value istrue
.
R
Gets or sets the RGB red component of the SelectedColor.
SelectedColor
Gets or sets the System.Windows.Media.Color that is selected in the picker.
public Color SelectedColor { get; set; }
Property Value
- System.Windows.Media.Color:
The System.Windows.Media.Color that is selected in the picker.
SelectedColorBrush
Gets a System.Windows.Media.Brush that uses the SelectedColor. This is a dependency property.
public Brush SelectedColorBrush { get; }
Property Value
- System.Windows.Media.Brush:
A System.Windows.Media.Brush.
SetColor
Gets the System.Windows.Input.ICommand for setting a color.
public static ICommand SetColor { get; }
Property Value
- System.Windows.Input.ICommand:
The System.Windows.Input.ICommand for setting a color.
Methods
OnApplyTemplate()
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 | System.Windows.Media.Color | The old value. |
newValue | System.Windows.Media.Color | The new value. |
Events
SelectedColorChanged
Occurs when the value of the SelectedColor property is changed.
public event RoutedPropertyChangedEventHandler<Color> SelectedColorChanged
Event Type
- System.Windows.RoutedPropertyChangedEventHandler<System.Windows.Media.Color>
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
DisabledOpacityProperty
Identifies the DisabledOpacity dependency property. This field is read-only.
public static readonly DependencyProperty DisabledOpacityProperty
GProperty
Identifies the G dependency property. This field is read-only.
public static readonly DependencyProperty GProperty
InitialColorBrushProperty
Identifies the read-only InitialColorBrush dependency property. This field is read-only.
public static readonly DependencyProperty InitialColorBrushProperty
InitialColorProperty
Identifies the InitialColor dependency property. This field is read-only.
public static readonly DependencyProperty InitialColorProperty
IsColorSwatchRowVisibleProperty
Identifies the IsColorSwatchRowVisible dependency property. This field is read-only.
public static readonly DependencyProperty IsColorSwatchRowVisibleProperty
IsInitialColorVisibleProperty
Identifies the IsInitialColorVisible dependency property. This field is read-only.
public static readonly DependencyProperty IsInitialColorVisibleProperty
RProperty
Identifies the R dependency property. This field is read-only.
public static readonly DependencyProperty RProperty
SelectedColorBrushProperty
Identifies the read-only SelectedColorBrush dependency property. This field is read-only.
public static readonly DependencyProperty SelectedColorBrushProperty
SelectedColorChangedEvent
Identifies the SelectedColorChanged routed event. This field is read-only.
public static readonly RoutedEvent SelectedColorChangedEvent
SelectedColorProperty
Identifies the SelectedColor dependency property. This field is read-only.
public static readonly DependencyProperty SelectedColorProperty
Inherited Members
- System.Object.ToString()
- System.Object.Equals(System.Object)
- System.Object.Equals(System.Object, System.Object)
- System.Object.ReferenceEquals(System.Object, System.Object)
- System.Object.GetHashCode()
- System.Object.GetType()
- System.Object.MemberwiseClone()
Extension Methods
- FrameworkElementExtensions.AnimateDoubleProperty(String, Double, Double, Double, Nullable<Double>, Nullable<Double>)
- FrameworkElementExtensions.BindToProperty(DependencyProperty, Object, String, BindingMode, IValueConverter, Object)
- FrameworkElementExtensions.BindToProperty(DependencyProperty, Object, DependencyProperty, BindingMode, IValueConverter, Object)
- FrameworkElementExtensions.GetCurrentSize()