Skip to content

Utils.TwoPositionsSelect

JaykeBird edited this page Feb 21, 2023 · 3 revisions

Back to home | Back to Reference | View raw text

TwoPositionsSelect class

Diagram

  flowchart LR
  classDef interfaceStyle stroke-dasharray: 5 5;
  classDef abstractStyle stroke-width:4px
  subgraph SolidShineUi.Utils
  SolidShineUi.Utils.TwoPositionsSelect[[TwoPositionsSelect]]
  end
  subgraph System.Windows.Markup
System.Windows.Markup.IComponentConnector[[IComponentConnector]]
  end
  subgraph System.Windows.Controls
System.Windows.Controls.UserControl[[UserControl]]
  end
System.Windows.Markup.IComponentConnector --> SolidShineUi.Utils.TwoPositionsSelect
System.Windows.Controls.UserControl --> SolidShineUi.Utils.TwoPositionsSelect
Loading

Members

Properties

Public properties

Type Name Methods
Brush BackgroundDisabledBrush
Get or set the brush to use for the background of the TwoPositionsSelect's box when it is disabled.
get, set
Brush BorderBrush
Get or set the brush used for the border of the TwoPositionsSelect's box.
get, set
Brush BorderDisabledBrush
Get or set the brush to use for the border of the cotnrol, while the control is disabled.
get, set
ColorScheme ColorScheme
Get or set the color scheme used for this TwoPositionsSelect. For easier color scheme management, bind this to the window or larger control you're using.
get, set
Brush ControlBackground
Get or set the brush used for the background of the TwoPositionsSelect's box.
get, set
ObservableCollection<double> HorizontalSnapPoints
Get or set the list of snap points that are displayed along the horizontal (X) axis of the control. 0.0 represents the far left of the control, and 1.0 represents the far right of the control.
get, set
double KeyMoveStep
Get or set the amount the selector is moved each time an arrow key is pressed (while the control is focused).
get, set
Brush KeyboardFocusHighlight
Get or set the brush used for the outline when the control is keyboard focused.
get, set
double SelectedHeight1
Get or set the first selected value on the vertical (Y) axis.
This is how far from the top of the control that the selector is, on a relative scale from 0.0 to 1.0 .
get, set
double SelectedHeight2
Get or set the second selected value on the vertical (Y) axis.
This is how far from the top of the control that the selector is, on a relative scale from 0.0 to 1.0 .
get, set
double SelectedWidth1
Get or set the first selected value on the horizontal (X) axis.
This is how far from the left edge of the control that the selector is, on a relative scale from 0.0 to 1.0 .
get, set
double SelectedWidth2
Get or set the second selected value on the horizontal (X) axis.
This is how far from the left edge of the control that the selector is, on a relative scale from 0.0 to 1.0 .
get, set
Brush SelectorBrush
Get or set the brush used for the selector ellipses in the TwoPositionsSelect.
get, set
Brush SelectorDisabledBrush
Get or set the brush used for the check mark when the control is disabled.
get, set
double SelectorSize
Get or set the size of the selector. The larger the selector, the easier it will be to see and also to click and drag, but also harder to visualize a particular value.
get, set
double SnapDistance
The distance, in pixels, within which the selector should snap to the nearest snap line.
The larger the distance, the further the selector can be away from a snap line before it snaps to the line.
get, set
Brush SnapLineBrush
Get or set the brush used for the snap point lines.
get, set
bool SnapToSnapLines
Get or set if the selector should snap to the snap lines within the control.
get, set
ObservableCollection<double> VerticalSnapPoints
Get or set the list of snap points that are displayed along the vertical (Y) axis of the control. 0.0 represents the far top of the control, and 1.0 represents the far bottom of the control.
get, set

Methods

Public Static methods

Returns Name
void OnColorSchemeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
Perform an action when the ColorScheme property has changed. Primarily used internally.
void OnKeyboardFocusHighlightBrushChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
Perform an action when a property of an object has changed. Primarily used internally.
void OnSnapLineBrushChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
Perform an action when a property of an object has changed. Primarily used internally.

Public methods

Returns Name
void ApplyColorScheme(ColorScheme cs)
Apply a color scheme to this control. The color scheme can quickly apply a whole visual style to the control.
void InitializeComponent()
InitializeComponent

Protected internal methods

Returns Name
void UpdateKeyboardFocusHighlightBrush()
An internal method to use for updating the brush when this control has keyboard focus.
void UpdateSnapLineBrush()
Updates the visuals of the snap lines in the control to match the SnapLineBrush property.

Details

Inheritance

  • IComponentConnector
  • UserControl

Constructors

TwoPositionsSelect

public TwoPositionsSelect()
Summary

Create a TwoPositionsSelect.

Methods

OnColorSchemeChanged

public static void OnColorSchemeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
Arguments
Type Name Description
DependencyObject d The object containing the property that changed.
DependencyPropertyChangedEventArgs e Event arguments about the property change.
Summary

Perform an action when the ColorScheme property has changed. Primarily used internally.

ApplyColorScheme

public void ApplyColorScheme(ColorScheme cs)
Arguments
Type Name Description
ColorScheme cs The color scheme to apply.
Summary

Apply a color scheme to this control. The color scheme can quickly apply a whole visual style to the control.

OnSnapLineBrushChanged

public static void OnSnapLineBrushChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
Arguments
Type Name Description
DependencyObject d The object containing the property that changed.
DependencyPropertyChangedEventArgs e Event arguments about the property change.
Summary

Perform an action when a property of an object has changed. Primarily used internally.

UpdateSnapLineBrush

protected internal void UpdateSnapLineBrush()
Summary

Updates the visuals of the snap lines in the control to match the SnapLineBrush property.

OnKeyboardFocusHighlightBrushChanged

public static void OnKeyboardFocusHighlightBrushChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
Arguments
Type Name Description
DependencyObject d The object containing the property that changed.
DependencyPropertyChangedEventArgs e Event arguments about the property change.
Summary

Perform an action when a property of an object has changed. Primarily used internally.

UpdateKeyboardFocusHighlightBrush

protected internal void UpdateKeyboardFocusHighlightBrush()
Summary

An internal method to use for updating the brush when this control has keyboard focus.

InitializeComponent

public virtual void InitializeComponent()
Summary

InitializeComponent

Properties

ColorScheme

public ColorScheme ColorScheme { get; set; }
Summary

Get or set the color scheme used for this TwoPositionsSelect. For easier color scheme management, bind this to the window or larger control you're using.

ControlBackground

public Brush ControlBackground { get; set; }
Summary

Get or set the brush used for the background of the TwoPositionsSelect's box.

SelectorBrush

public Brush SelectorBrush { get; set; }
Summary

Get or set the brush used for the selector ellipses in the TwoPositionsSelect.

BackgroundDisabledBrush

public Brush BackgroundDisabledBrush { get; set; }
Summary

Get or set the brush to use for the background of the TwoPositionsSelect's box when it is disabled.

BorderDisabledBrush

public Brush BorderDisabledBrush { get; set; }
Summary

Get or set the brush to use for the border of the cotnrol, while the control is disabled.

SelectorDisabledBrush

public Brush SelectorDisabledBrush { get; set; }
Summary

Get or set the brush used for the check mark when the control is disabled.

BorderBrush

public Brush BorderBrush { get; set; }
Summary

Get or set the brush used for the border of the TwoPositionsSelect's box.

SnapLineBrush

public Brush SnapLineBrush { get; set; }
Summary

Get or set the brush used for the snap point lines.

KeyboardFocusHighlight

public Brush KeyboardFocusHighlight { get; set; }
Summary

Get or set the brush used for the outline when the control is keyboard focused.

SnapToSnapLines

public bool SnapToSnapLines { get; set; }
Summary

Get or set if the selector should snap to the snap lines within the control.

SnapDistance

public double SnapDistance { get; set; }
Summary

The distance, in pixels, within which the selector should snap to the nearest snap line. The larger the distance, the further the selector can be away from a snap line before it snaps to the line.

HorizontalSnapPoints

public ObservableCollection<double> HorizontalSnapPoints { get; set; }
Summary

Get or set the list of snap points that are displayed along the horizontal (X) axis of the control. 0.0 represents the far left of the control, and 1.0 represents the far right of the control.

VerticalSnapPoints

public ObservableCollection<double> VerticalSnapPoints { get; set; }
Summary

Get or set the list of snap points that are displayed along the vertical (Y) axis of the control. 0.0 represents the far top of the control, and 1.0 represents the far bottom of the control.

SelectorSize

public double SelectorSize { get; set; }
Summary

Get or set the size of the selector. The larger the selector, the easier it will be to see and also to click and drag, but also harder to visualize a particular value.

KeyMoveStep

public double KeyMoveStep { get; set; }
Summary

Get or set the amount the selector is moved each time an arrow key is pressed (while the control is focused).

SelectedWidth1

public double SelectedWidth1 { get; set; }
Summary

Get or set the first selected value on the horizontal (X) axis. This is how far from the left edge of the control that the selector is, on a relative scale from 0.0 to 1.0 .

SelectedHeight1

public double SelectedHeight1 { get; set; }
Summary

Get or set the first selected value on the vertical (Y) axis. This is how far from the top of the control that the selector is, on a relative scale from 0.0 to 1.0 .

SelectedWidth2

public double SelectedWidth2 { get; set; }
Summary

Get or set the second selected value on the horizontal (X) axis. This is how far from the left edge of the control that the selector is, on a relative scale from 0.0 to 1.0 .

SelectedHeight2

public double SelectedHeight2 { get; set; }
Summary

Get or set the second selected value on the vertical (Y) axis. This is how far from the top of the control that the selector is, on a relative scale from 0.0 to 1.0 .

Events

ColorSchemeChanged

public event DependencyPropertyChangedEventHandler ColorSchemeChanged
Summary

Raised when the ColorScheme property is changed.

SelectedPositionChanged

public event EventHandler SelectedPositionChanged
Summary

Raised when any of the SelectedHeight or SelectedWidth properties change (i.e., when the selector was moved).

Generated with ModularDoc

Clone this wiki locally