SpectrumSlider Class
Represents a hue spectrum slider control.
[TemplatePart(Name = "PART_Spectrum", Type = typeof(Rectangle))]
public class SpectrumSlider : Slider
Constructors
SpectrumSlider()
Initializes an instance of the class.
public SpectrumSlider()
Properties
SelectedColor
The Color that is selected in the slider.
Methods
OnApplyTemplate()
Builds the visual tree for the Slider control.
public override void OnApplyTemplate()
OnMouseLeftButtonUp(MouseButtonEventArgs)
Invoked when an unhandled MouseLeftButtonUp routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | MouseButtonEventArgs | The MouseButtonEventArgs that contains the event data. The event data reports that the left mouse button was released. |
OnMouseMove(MouseEventArgs)
Invoked when an unhandled System.Windows.Input.Mouse.MouseMove attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected override void OnMouseMove(MouseEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | MouseEventArgs | The MouseEventArgs that contains the event data. |
OnMouseWheel(MouseWheelEventArgs)
Invoked when an unhandled System.Windows.Input.Mouse.MouseWheel attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected override void OnMouseWheel(MouseWheelEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | MouseWheelEventArgs | The MouseWheelEventArgs that contains the event data. |
OnPreviewMouseLeftButtonDown(MouseButtonEventArgs)
Provides class handling for the PreviewMouseLeftButtonDown routed event.
protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | MouseButtonEventArgs | The event data. |
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. |
OnValueChanged(double, double)
protected override void OnValueChanged(double oldValue, double newValue)
| Parameter | Type | Description |
|---|---|---|
| oldValue | double | |
| newValue | double |
Events
SelectedColorChanged
Occurs when the value of the SelectedColor property is changed.
public event RoutedPropertyChangedEventHandler<Color> SelectedColorChanged
Event Type
Fields
SelectedColorChangedEvent
Defines the SelectedColorChanged event.
public static readonly RoutedEvent SelectedColorChangedEvent
SelectedColorProperty
Defines the SelectedColor property.
public static readonly DependencyProperty SelectedColorProperty