Skip to content

DoubleSpinner

JaykeBird edited this page Feb 21, 2023 · 9 revisions

Back to home | Back to Reference | View raw text

DoubleSpinner class

Diagram

  flowchart LR
  classDef interfaceStyle stroke-dasharray: 5 5;
  classDef abstractStyle stroke-width:4px
  subgraph SolidShineUi
  SolidShineUi.DoubleSpinner[[DoubleSpinner]]
  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.DoubleSpinner
System.Windows.Controls.UserControl --> SolidShineUi.DoubleSpinner
Loading

Members

Properties

Public properties

Type Name Methods
bool AcceptExpressions
Get or set if the spinner should evaluate arithmetic expressions (such as "2+5") to accept as a value.
get, set
Brush BorderBrush
Get or set the brush of the border around the control.
get, set
Brush BorderDisabledBrush
Get or set the brush used for the border around the control, while the control is disabled.
get, set
Brush ButtonBackground
Get or set the brush used for the background of the buttons of the spinner.
get, set
Brush ClickBrush
Get or set the brush used when a button is being clicked.
get, set
ColorScheme ColorScheme
Get or set the color scheme used for this spinner. For easier color scheme management, bind this to the window or larger control you're using.
get, set
CornerRadius CornerRadius
Get or set the corner radius to use around the corners of this control. Setting the corner radius to a value other than 0 displays rounded corners.
get, set
int Decimals
Get or set how many decimal places to display. Values entered with a more precise decimal value will be rounded.
get, set
Brush DisabledBrush
Get or set the brush used for the background of the buttons when the control is disabled.
get, set
Brush HighlightBrush
Get or set the brush used when a button is highlighted (i.e. has a mouse over it or keyboard focus).
get, set
double MaxValue
Get or set the maximum value allowed for this spinner (inclusive).
get, set
double MinValue
Get or set the minimum value allowed for this spinner (inclusive).
get, set
int MinimumDigitCount
Get or set the minimum number of integral digits to display in the spinner. A value of 0 or lower will revert the display to using the standard double display format.
get, set
double RepeatDelay
Get or set the delay period before starting the repeatedly stepping up or down while the button is held, in milliseconds. Default is 300 milliseconds.
get, set
bool ShowArrows
Get or set whether the up and down arrow buttons are shown.
get, set
double Step
Get or set how much to change the value by when you press the up or down button.
get, set
double Value
Get or set the value of the spinner.
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.

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

Details

Inheritance

  • IComponentConnector
  • UserControl

Constructors

DoubleSpinner

public DoubleSpinner()
Summary

Create a DoubleSpinner.

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.

InitializeComponent

public virtual void InitializeComponent()
Summary

InitializeComponent

Properties

ColorScheme

public ColorScheme ColorScheme { get; set; }
Summary

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

ButtonBackground

public Brush ButtonBackground { get; set; }
Summary

Get or set the brush used for the background of the buttons of the spinner.

DisabledBrush

public Brush DisabledBrush { get; set; }
Summary

Get or set the brush used for the background of the buttons when the control is disabled.

BorderBrush

public Brush BorderBrush { get; set; }
Summary

Get or set the brush of the border around the control.

HighlightBrush

public Brush HighlightBrush { get; set; }
Summary

Get or set the brush used when a button is highlighted (i.e. has a mouse over it or keyboard focus).

ClickBrush

public Brush ClickBrush { get; set; }
Summary

Get or set the brush used when a button is being clicked.

BorderDisabledBrush

public Brush BorderDisabledBrush { get; set; }
Summary

Get or set the brush used for the border around the control, while the control is disabled.

Value

public double Value { get; set; }
Summary

Get or set the value of the spinner.

Step

public double Step { get; set; }
Summary

Get or set how much to change the value by when you press the up or down button.

Decimals

public int Decimals { get; set; }
Summary

Get or set how many decimal places to display. Values entered with a more precise decimal value will be rounded.

Remarks

This must be a value between 0 (which means round up to an integer number) and 15, inclusive. The default value is 2.

MinValue

public double MinValue { get; set; }
Summary

Get or set the minimum value allowed for this spinner (inclusive).

MaxValue

public double MaxValue { get; set; }
Summary

Get or set the maximum value allowed for this spinner (inclusive).

RepeatDelay

public double RepeatDelay { get; set; }
Summary

Get or set the delay period before starting the repeatedly stepping up or down while the button is held, in milliseconds. Default is 300 milliseconds.

CornerRadius

public CornerRadius CornerRadius { get; set; }
Summary

Get or set the corner radius to use around the corners of this control. Setting the corner radius to a value other than 0 displays rounded corners.

AcceptExpressions

public bool AcceptExpressions { get; set; }
Summary

Get or set if the spinner should evaluate arithmetic expressions (such as "2+5") to accept as a value.

Remarks

See the ArithmeticParser class for more info about how expressions are parsed.

ShowArrows

public bool ShowArrows { get; set; }
Summary

Get or set whether the up and down arrow buttons are shown.

MinimumDigitCount

public int MinimumDigitCount { get; set; }
Summary

Get or set the minimum number of integral digits to display in the spinner. A value of 0 or lower will revert the display to using the standard double display format.

Remarks

This modifies the number of digits being rendered via Double.ToString(System.String) . Setting this to 4 and then setting the Value to 16 will render the text 0016 in the display. The stored value isn't affected. This setting only modifies the integral (integer) part of the number; use the DoubleSpinner.Decimals property for modifying how many numbers to display after the decimal point. You should generally avoid setting this to numbers larger than 99, as larger numbers are only supported in newer versions of .NET.

Events

PropertyChanged

public event EventHandler PropertyChanged
Summary

Raised when the Value, Decimals, MinValue, or MaxValue properties are changed. Used internally to trigger revalidating the value.

ValueChanged

public event DependencyPropertyChangedEventHandler ValueChanged
Summary

Raised when the Value property is changed.

ValueValidated

public event EventHandler ValueValidated
Summary

Raised when the Value property is validated, and changed to a valid value if needed.

ColorSchemeChanged

public event DependencyPropertyChangedEventHandler ColorSchemeChanged
Summary

Raised when the ColorScheme property is changed.

InternalValueChanged

protected event DependencyPropertyChangedEventHandler InternalValueChanged
Summary

Internal event for handling a property changed. Please view the event that is not prefixed as "Internal".

InternalRepeatDelayChanged

protected event DependencyPropertyChangedEventHandler InternalRepeatDelayChanged
Summary

Internal event for handling a property changed. Please view the event that is not prefixed as "Internal".

RepeatDelayChanged

public event RoutedEventHandler RepeatDelayChanged
Summary

Raised when the RepeatDelay property is changed.

InternalCornerRadiusChanged

protected event DependencyPropertyChangedEventHandler InternalCornerRadiusChanged
Summary

Internal event for handling a property changed. Please view the event that is not prefixed as "Internal".

CornerRadiusChanged

public event RoutedEventHandler CornerRadiusChanged
Summary

Raised when the CornerRadius property is changed.

InternalShowArrowsChanged

protected event DependencyPropertyChangedEventHandler InternalShowArrowsChanged
Summary

Internal event for handling a property changed. Please view the event that is not prefixed as "Internal".

ShowArrowsChanged

public event RoutedEventHandler ShowArrowsChanged
Summary

Raised when the ShowArrows property is changed.

Generated with ModularDoc

Clone this wiki locally