Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/Xamarin.PropertyEditing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominique Louis <savagesoftware@gmail.com>2018-03-29 18:38:16 +0300
committerDominique Louis <savagesoftware@gmail.com>2018-03-29 19:22:36 +0300
commitfc38fa86bc575b731b978c199d5bbd4f3acbb070 (patch)
tree8e32acb4b89888735e43fc748b2500bea7738388 /Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs
parentb032c2582df5310a497356c5c072ab93af59a181 (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.cs6
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 ()