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:
authorStephen Shaw <sshaw@decriptor.com>2019-10-17 00:55:22 +0300
committerStephen Shaw <sshaw@decriptor.com>2019-10-17 00:55:22 +0300
commitc1954c6c35b6983a08a62638b93e02f33e480e2a (patch)
treef0c4c83274737c034067722dff046e1967c07182 /Xamarin.PropertyEditing.Mac/Controls/CustomExpressionView.cs
parentda4f83a9e6cf83631192ec21e96cb941f8f0b21a (diff)
[Mac] CustomExpressionView always set editorControl
This prevents editorControl from ever being null
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/Controls/CustomExpressionView.cs')
-rw-r--r--Xamarin.PropertyEditing.Mac/Controls/CustomExpressionView.cs8
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;