From c1954c6c35b6983a08a62638b93e02f33e480e2a Mon Sep 17 00:00:00 2001 From: Stephen Shaw Date: Wed, 16 Oct 2019 15:55:22 -0600 Subject: [Mac] CustomExpressionView always set editorControl This prevents editorControl from ever being null --- Xamarin.PropertyEditing.Mac/Controls/CustomExpressionView.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Xamarin.PropertyEditing.Mac') diff --git a/Xamarin.PropertyEditing.Mac/Controls/CustomExpressionView.cs b/Xamarin.PropertyEditing.Mac/Controls/CustomExpressionView.cs index ed82e78..af435dc 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/CustomExpressionView.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/CustomExpressionView.cs @@ -33,13 +33,13 @@ namespace Xamarin.PropertyEditing.Mac NSControl editorControl = null; PropertyInfo customAutocompleteItemsPropertyInfo = vmType.GetProperty (AutocompleteItemsString); if (customAutocompleteItemsPropertyInfo.GetValue (viewModel) is ObservableCollectionEx values) { - if (values != null && values.Count > 0) { + if (values != null && values.Count > 0) editorControl = new AutocompleteComboBox (hostResources, viewModel, values, previewCustomExpressionPropertyInfo); - } else { - editorControl = new NSTextField (); - } } + if (editorControl == null) + editorControl = new NSTextField (); + editorControl.TranslatesAutoresizingMaskIntoConstraints = false; editorControl.StringValue = (string)value ?? string.Empty; -- cgit v1.2.3