avalonia docs


The NumericUpDown is an editable numeric input field.

The control has a up and down button spinner attached, used to increment and decrement the value in the input field. The value can also be incremented or decremented using the arrow keys or the mouse wheel when the control is selected.



Source code



Basic NumericUpDown

The value stored in the NumericUpDown is a double.

<NumericUpDown Value="10" Width="100"/>

produces the following output on Linux
Basic NumericUpDown

NumericUpDown with a changed increment and bounds

A custom increment/decrement value can be set for the button spinner. The default increment value is set to 1.

<NumericUpDown Value="0.5" Increment="0.01" Minimum="0" Maximum="1"/>

NumericUpDown without a button spinner

<NumericUpDown Value="42" AllowSpin="false" ShowButtonSpinner="false"/>

Common Properties

Property Description
Value The double stored in the NumericUpDown
Increment The increment used by the button spinner, keyboard and mouse wheel
Minimum The minimum allowed Value
Maximum The maximum allowed Value
ButtonSpinnerLocation Location of the button spinner - Left or Right
AllowSpin If false incrementing and decrementing using the button spinner, keyboard and mouse wheel is disabled
ShowButtonSpinner Determines whether the button spinner should be shown