|
@@ -248,16 +248,18 @@ public class FilterNode<T> : BaseFilterNode
|
|
|
|
|
|
private ConstantNode? CreateConstantNode(string? propertyName, Operator op, FilterConstant? constantvalue)
|
|
|
{
|
|
|
- var values = new Dictionary<string, FilterConstant?>();
|
|
|
+ var values = new List<KeyValuePair<string, FilterConstant?>>();
|
|
|
if (!string.IsNullOrWhiteSpace(propertyName))
|
|
|
{
|
|
|
var property = CoreUtils.GetProperty(typeof(T), propertyName);
|
|
|
var constants = FilterConstants.Constants(property.PropertyType, op);
|
|
|
if (constants.Any())
|
|
|
{
|
|
|
- values[""] = null;
|
|
|
+ values.Add(new KeyValuePair<string, FilterConstant?>("", null));
|
|
|
foreach (var constant in constants)
|
|
|
- values[CoreUtils.Neatify(constant.ToString())] = constant;
|
|
|
+ {
|
|
|
+ values.Add(new KeyValuePair<string, FilterConstant?>(CoreUtils.Neatify(constant.ToString()), constant));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -266,13 +268,14 @@ public class FilterNode<T> : BaseFilterNode
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- var result = new ConstantNode();
|
|
|
-
|
|
|
- result.DisplayMemberPath = "Key";
|
|
|
- result.SelectedValuePath = "Value";
|
|
|
- result.ItemsSource = values;
|
|
|
- result.SelectedConstant = constantvalue;
|
|
|
- result.Margin = new Thickness(0, 0, 5, 0);
|
|
|
+ var result = new ConstantNode
|
|
|
+ {
|
|
|
+ DisplayMemberPath = "Key",
|
|
|
+ SelectedValuePath = "Value",
|
|
|
+ ItemsSource = values,
|
|
|
+ SelectedConstant = constantvalue,
|
|
|
+ Margin = new Thickness(0, 0, 5, 0)
|
|
|
+ };
|
|
|
result.ConstantChanged += ConstantChanged;
|
|
|
return result;
|
|
|
}
|