diff options
author | Dominique Louis <savagesoftware@gmail.com> | 2018-03-29 18:38:16 +0300 |
---|---|---|
committer | Dominique Louis <savagesoftware@gmail.com> | 2018-03-29 19:22:36 +0300 |
commit | fc38fa86bc575b731b978c199d5bbd4f3acbb070 (patch) | |
tree | 8e32acb4b89888735e43fc748b2500bea7738388 /Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs | |
parent | b032c2582df5310a497356c5c072ab93af59a181 (diff) |
Change to allow NumericEditor to handle nullables.
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs')
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs | 6 |
1 files changed, 5 insertions, 1 deletions
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 () |