In This Article

SpectrumSlider Class

Represents a hue spectrum slider control.

public class SpectrumSlider : Slider
Inheritance:
object Visual UIElement FrameworkElement Control RangeBase Slider object

Remarks

For detailed documentation on this control's features and how to use them, please see the Shared Color Selection documentation topic.

Constructors

SpectrumSlider()

Initializes an instance of the SpectrumSlider class.

public SpectrumSlider()

Properties

SelectedColor

Gets or sets the Color that is selected in the slider.

public Color SelectedColor { get; set; }

Property Value

Color:

The Color that is selected in the slider.

Methods

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.

OnMouseWheel(MouseWheelEventArgs)

Invoked when an unhandled UIElement.MouseWheel attached event is raised on this element. Implement this method to add class handling for this event.

protected override void OnMouseWheel(MouseWheelEventArgs e)
Parameter Type Description
e MouseWheelEventArgs

A MouseWheelEventArgs that contains the event data.

OnPreviewMouseLeftButtonDown(MouseButtonEventArgs)

Invoked when an unhandled UIElement.PreviewMouseLeftButtonDown attached event is raised on this element. Implement this method to add class handling for this event.

protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e)
Parameter Type Description
e MouseButtonEventArgs

A MouseButtonEventArgs that contains 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)

Occurs when the value of the slider changes.

protected override void OnValueChanged(double oldValue, double newValue)
Parameter Type Description
oldValue double

The old value.

newValue double

The new value.

Events

SelectedColorChanged

Occurs when the value of the SelectedColor property is changed.

public event RoutedPropertyChangedEventHandler<Color> SelectedColorChanged

Event Type

RoutedPropertyChangedEventHandler<Color>

Fields

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