SpectrumSlice Class
Represents a hue spectrum slice control.
public class SpectrumSlice : 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
SpectrumSlice()
Initializes an instance of the SpectrumSlice
class.
public SpectrumSlice()
Properties
BaseColor
Gets or sets the System.Windows.Media.Color that is used to construct the slice.
public Color BaseColor { get; set; }
Property Value
- System.Windows.Media.Color:
The System.Windows.Media.Color that is used to construct the slice.
BaseColorBrush
Gets a System.Windows.Media.Brush that uses the BaseColor. This is a dependency property.
public Brush BaseColorBrush { get; }
Property Value
- System.Windows.Media.Brush:
A System.Windows.Media.Brush.
MarkedColor
Gets the System.Windows.Media.Color that the marker is over in the slice. This is a dependency property.
public Color MarkedColor { get; }
Property Value
- System.Windows.Media.Color:
The System.Windows.Media.Color that the marker is over in the slice.
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 System.Windows.Media.Brush that uses the MarkedColor. This is a dependency property.
public Brush MarkedColorBrush { get; }
Property Value
- System.Windows.Media.Brush:
A System.Windows.Media.Brush.
SelectedColor
Gets or sets the System.Windows.Media.Color that is selected in the slice. This is a dependency property.
public Color SelectedColor { get; set; }
Property Value
- System.Windows.Media.Color:
The System.Windows.Media.Color that is selected in the slice.
Methods
OnMouseLeftButtonDown(MouseButtonEventArgs)
Invoked when an unhandled System.Windows.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 | System.Windows.Input.MouseButtonEventArgs | A System.Windows.Input.MouseButtonEventArgs that contains the event data. |
OnMouseLeftButtonUp(MouseButtonEventArgs)
Invoked when an unhandled System.Windows.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 | System.Windows.Input.MouseButtonEventArgs | A System.Windows.Input.MouseButtonEventArgs that contains the event data. |
OnMouseMove(MouseEventArgs)
Invoked when an unhandled System.Windows.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 | System.Windows.Input.MouseEventArgs | A System.Windows.Input.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 | System.Windows.SizeChangedInfo | Specifies the size changes. |
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
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
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()