From fc38fa86bc575b731b978c199d5bbd4f3acbb070 Mon Sep 17 00:00:00 2001 From: Dominique Louis Date: Thu, 29 Mar 2018 17:38:16 +0200 Subject: Change to allow NumericEditor to handle nullables. --- Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs') diff --git a/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs index 42f1257..5241742 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs @@ -105,7 +105,11 @@ namespace Xamarin.PropertyEditing.Mac protected override void UpdateValue() { - NumericEditor.Value = (double)Convert.ChangeType ((ViewModel).Value, typeof(double)); + if (underlyingType != null) { + NumericEditor.StringValue = ViewModel.Value == null ? string.Empty : ViewModel.Value.ToString (); + } else { + NumericEditor.Value = (double)Convert.ChangeType (ViewModel.Value, typeof (double)); + } } protected override void UpdateAccessibilityValues () -- cgit v1.2.3