SpectrumSlice Class
Represents a hue spectrum slice control.
public class SpectrumSlice : Control
- Inheritance:
- object Visual UIElement FrameworkElement 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
SpectrumSlice()
Initializes an instance of the SpectrumSlice
class.
public SpectrumSlice()
Properties
BaseColor
Gets or sets the Color that is used to construct the slice.
public Color BaseColor { get; set; }
Property Value
BaseColorBrush
MarkedColor
Gets the Color that the marker is over in the slice. This is a dependency property.
public Color MarkedColor { get; }
Property Value
Remarks
When the mouse is used to drag the marker, this color is set to the SelectedColor property upon the release of the mouse button.
MarkedColorBrush
Gets a Brush that uses the MarkedColor. This is a dependency property.
SelectedColor
Gets or sets the Color that is selected in the slice. This is a dependency property.
public Color SelectedColor { get; set; }
Property Value
Methods
OnMouseLeftButtonDown(MouseButtonEventArgs)
Invoked when an unhandled UIElement.MouseLeftButtonDown attached event is raised on this element. Implement this method to add class handling for this event.
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameter | Type | Description |
---|---|---|
e | MouseButtonEventArgs | A MouseButtonEventArgs that contains the event data. |
OnMouseLeftButtonUp(MouseButtonEventArgs)
Invoked when an unhandled UIElement.MouseLeftButtonUp attached event is raised on this element. Implement this method to add class handling for this event.
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
Parameter | Type | Description |
---|---|---|
e | MouseButtonEventArgs | A MouseButtonEventArgs that contains the event data. |
OnMouseMove(MouseEventArgs)
Invoked when an unhandled UIElement.MouseMove attached event is raised on this element. Implement this method to add class handling for this event.
protected override void OnMouseMove(MouseEventArgs e)
Parameter | Type | Description |
---|---|---|
e | MouseEventArgs | A MouseEventArgs that contains the event data. |
OnRenderSizeChanged(SizeChangedInfo)
Called when the rendered size of a control changes.
protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
Parameter | Type | Description |
---|---|---|
sizeInfo | SizeChangedInfo | Specifies the size changes. |
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
Fields
BaseColorBrushProperty
Identifies the read-only BaseColorBrush dependency property. This field is read-only.
public static readonly DependencyProperty BaseColorBrushProperty
BaseColorProperty
Identifies the BaseColor dependency property. This field is read-only.
public static readonly DependencyProperty BaseColorProperty
MarkedColorBrushProperty
Identifies the MarkedColorBrush dependency property. This field is read-only.
public static readonly DependencyProperty MarkedColorBrushProperty
MarkedColorProperty
Identifies the MarkedColor dependency property. This field is read-only.
public static readonly DependencyProperty MarkedColorProperty
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