numericupdownavalonia

How do I style an Avalonia NumericUpDown control integer-only?


Every time I click the Up or Down button of an Avalonia NumericUpDown control a period with a zero gets added to the value, i.e. it increases as 2.0, 3.0, 4.0 etc. instead of 2, 3, 4 (which would be the desired behaviour).

The decimal point and the zero only disappear as soon as the application window loses focus and appear again once I click decrease/increase again.

How do I possibly change this?

An answer to a similar question suggests setting the DecimalPlaces property to zero but the Avalonia implementation of the control appears lacking this property.


Solution

  • Just specify the incrementation level, it should be automatic.

    <NumericUpDown Increment="1" />