diff --git a/samples/ControlCatalog/ControlCatalog.csproj b/samples/ControlCatalog/ControlCatalog.csproj
index a3d7a0cdce..5d8f661990 100644
--- a/samples/ControlCatalog/ControlCatalog.csproj
+++ b/samples/ControlCatalog/ControlCatalog.csproj
@@ -78,6 +78,9 @@
Designer
+
+ Designer
+
Designer
@@ -169,6 +172,9 @@
ButtonSpinnerPage.xaml
+
+
+ NumericUpDownPage.xaml
diff --git a/samples/ControlCatalog/MainView.xaml b/samples/ControlCatalog/MainView.xaml
index 142d0d42b1..a2e0980d6a 100644
--- a/samples/ControlCatalog/MainView.xaml
+++ b/samples/ControlCatalog/MainView.xaml
@@ -19,6 +19,7 @@
+
diff --git a/samples/ControlCatalog/Pages/NumericUpDownPage.xaml b/samples/ControlCatalog/Pages/NumericUpDownPage.xaml
new file mode 100644
index 0000000000..a5c911f47d
--- /dev/null
+++ b/samples/ControlCatalog/Pages/NumericUpDownPage.xaml
@@ -0,0 +1,80 @@
+
+
+ Numeric up-down control
+ Numeric up-down control provides a TextBox with button spinners that allow incrementing and decrementing numeric values by using the spinner buttons, keyboard up/down arrows, or mouse wheel.
+
+ Features:
+
+
+ ShowButtonSpinner:
+
+
+ IsReadOnly:
+
+
+ AllowSpin:
+
+
+ ClipValueToMinMax:
+
+
+
+
+ FormatString:
+
+
+
+
+
+
+
+
+
+
+
+
+ ButtonSpinnerLocation:
+
+
+ CultureInfo:
+
+
+ Watermark:
+
+
+ Text:
+
+
+
+ Minimum:
+
+
+ Maximum:
+
+
+ Increment:
+
+
+ Value:
+
+
+
+
+
+
+ Usage of NumericUpDown:
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/ControlCatalog/Pages/NumericUpDownPage.xaml.cs b/samples/ControlCatalog/Pages/NumericUpDownPage.xaml.cs
new file mode 100644
index 0000000000..92da64d87e
--- /dev/null
+++ b/samples/ControlCatalog/Pages/NumericUpDownPage.xaml.cs
@@ -0,0 +1,94 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Controls.Primitives;
+using Avalonia.Markup.Xaml;
+using ReactiveUI;
+
+namespace ControlCatalog.Pages
+{
+ public class NumericUpDownPage : UserControl
+ {
+ public NumericUpDownPage()
+ {
+ this.InitializeComponent();
+ var viewModel = new NumbersPageViewModel();
+ DataContext = viewModel;
+ }
+
+ private void InitializeComponent()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+
+ }
+
+ public class NumbersPageViewModel : ReactiveObject
+ {
+ private IList _formats;
+ private FormatObject _selectedFormat;
+ private IList _spinnerLocations;
+
+ public NumbersPageViewModel()
+ {
+ SelectedFormat = Formats.FirstOrDefault();
+ }
+
+ public IList Formats
+ {
+ get
+ {
+ return _formats ?? (_formats = new List()
+ {
+ new FormatObject() {Name = "Currency", Value = "C2"},
+ new FormatObject() {Name = "Fixed point", Value = "F2"},
+ new FormatObject() {Name = "General", Value = "G"},
+ new FormatObject() {Name = "Number", Value = "N"},
+ new FormatObject() {Name = "Percent", Value = "P"},
+ new FormatObject() {Name = "Degrees", Value = "{0:N2} °"},
+ });
+ }
+ }
+
+ public IList SpinnerLocations
+ {
+ get
+ {
+ if (_spinnerLocations == null)
+ {
+ _spinnerLocations = new List();
+ foreach (Location value in Enum.GetValues(typeof(Location)))
+ {
+ _spinnerLocations.Add(value);
+ }
+ }
+ return _spinnerLocations ;
+ }
+ }
+
+ public IList Cultures { get; } = new List()
+ {
+ new CultureInfo("en-US"),
+ new CultureInfo("en-GB"),
+ new CultureInfo("fr-FR"),
+ new CultureInfo("ar-DZ"),
+ new CultureInfo("zh-CN"),
+ new CultureInfo("cs-CZ")
+ };
+
+ public FormatObject SelectedFormat
+ {
+ get { return _selectedFormat; }
+ set { this.RaiseAndSetIfChanged(ref _selectedFormat, value); }
+ }
+ }
+
+ public class FormatObject
+ {
+ public string Value { get; set; }
+ public string Name { get; set; }
+ }
+}
diff --git a/src/Avalonia.Controls/ButtonSpinner.cs b/src/Avalonia.Controls/ButtonSpinner.cs
index 3ce81e0b12..866237ecce 100644
--- a/src/Avalonia.Controls/ButtonSpinner.cs
+++ b/src/Avalonia.Controls/ButtonSpinner.cs
@@ -201,6 +201,11 @@ namespace Avalonia.Controls
}
}
+ protected override void OnValidSpinDirectionChanged(ValidSpinDirections oldValue, ValidSpinDirections newValue)
+ {
+ SetButtonUsage();
+ }
+
///
/// Called when the property value changed.
///
diff --git a/src/Avalonia.Controls/MenuItem.cs b/src/Avalonia.Controls/MenuItem.cs
index dadd3b910b..96f6fb59b0 100644
--- a/src/Avalonia.Controls/MenuItem.cs
+++ b/src/Avalonia.Controls/MenuItem.cs
@@ -93,6 +93,7 @@ namespace Avalonia.Controls
static MenuItem()
{
SelectableMixin.Attach