In This Article

SpectrumSlice Class

Represents a hue spectrum slice control.

[TemplatePart(Name = "PART_Marker", Type = typeof(Path))]
public class SpectrumSlice : Control
Inheritance:
object Visual UIElement FrameworkElement Control object

Constructors

SpectrumSlice()

Initializes an instance of the class.

public SpectrumSlice()

Properties

BaseColor

The Color that is used to construct the slice.

public Color BaseColor { get; set; }

Property Value

Color

BaseColorBrush

A Brush that uses the BaseColor.

public Brush BaseColorBrush { get; }

Property Value

Brush

MarkedColor

The Color that the marker is over in the slice.

public Color MarkedColor { get; }

Property Value

Color

Remarks

When the mouse is used to drag the marker, this color is updated to the SelectedColor property upon the release of the mouse button.

MarkedColorBrush

A Brush that uses the MarkedColor.

public Brush MarkedColorBrush { get; }

Property Value

Brush

SelectedColor

The Color that is selected in the slice.

public Color SelectedColor { get; set; }

Property Value

Color

Methods

OnApplyTemplate()

When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().

public override void OnApplyTemplate()

OnMouseLeftButtonDown(MouseButtonEventArgs)

Invoked when an unhandled MouseLeftButtonDown routed 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

The MouseButtonEventArgs that contains the event data. The event data reports that the left mouse button was pressed.

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.

OnRenderSizeChanged(SizeChangedInfo)

Raises the SizeChanged event, using the specified information as part of the eventual event data.

protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
Parameter Type Description
sizeInfo SizeChangedInfo

Details of the old and new size involved in the change.

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

RoutedPropertyChangedEventHandler<Color>

Fields

BaseColorBrushProperty

Defines the BaseColorBrush property.

public static readonly DependencyProperty BaseColorBrushProperty

BaseColorProperty

Defines the BaseColor property.

public static readonly DependencyProperty BaseColorProperty

MarkedColorBrushProperty

Defines the MarkedColorBrush property.

public static readonly DependencyProperty MarkedColorBrushProperty

MarkedColorProperty

Defines the MarkedColor property.

public static readonly DependencyProperty MarkedColorProperty

SelectedColorChangedEvent

Defines the SelectedColorChanged event.

public static readonly RoutedEvent SelectedColorChangedEvent

SelectedColorProperty

Defines the SelectedColor property.

public static readonly DependencyProperty SelectedColorProperty

Extension Methods