diff options
author | Stephen Shaw <sshaw@decriptor.com> | 2019-10-17 00:55:22 +0300 |
---|---|---|
committer | Stephen Shaw <sshaw@decriptor.com> | 2019-10-17 00:55:22 +0300 |
commit | c1954c6c35b6983a08a62638b93e02f33e480e2a (patch) | |
tree | f0c4c83274737c034067722dff046e1967c07182 | |
parent | da4f83a9e6cf83631192ec21e96cb941f8f0b21a (diff) |
[Mac] CustomExpressionView always set editorControl
This prevents editorControl from ever being null
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/CustomExpressionView.cs | 8 |
1 files changed, 4 insertions, 4 deletions
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<string> 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; |