diff options
author | Eric Maupin <ermaup@microsoft.com> | 2019-01-15 01:01:03 +0300 |
---|---|---|
committer | Eric Maupin <ermaup@microsoft.com> | 2019-02-15 20:35:53 +0300 |
commit | dcac85f184a7fce4297904358ab2099efc031da8 (patch) | |
tree | 3d783b2ad673a5c440e0b6d144dcccc80e284aeb /Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs | |
parent | 38ea4489eaf0b4b8975e65527ff59b35c29875de (diff) |
[mac] ViewModel is allowed to be null
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs')
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs index e6b1277..e15e206 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs @@ -133,6 +133,11 @@ namespace Xamarin.PropertyEditing.Mac protected override void OnViewModelChanged (PropertyViewModel oldModel) { + base.OnViewModelChanged (oldModel); + + if (ViewModel == null) + return; + if (ViewModel.HasInputModes) { if (this.inputModePopup == null) { this.inputModePopup = new NSPopUpButton { @@ -169,8 +174,6 @@ namespace Xamarin.PropertyEditing.Mac // If we are reusing the control we'll have to hid the inputMode if this doesn't have InputMode. if (this.inputModePopup != null) this.inputModePopup.Hidden = !ViewModel.HasInputModes; - - base.OnViewModelChanged (oldModel); } } } |