Skip to content

Commit c4298a3

Browse files
committed
IndicatorDiagramElement. Support nullable property types.
1 parent 3b7c069 commit c4298a3

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Diagram.Core/Elements/IndicatorDiagramElement.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,14 @@ IDiagramElementParam createParam(Type propType)
230230
propType == typeof(DateTimeOffset) ||
231231
propType.IsEnum)
232232
{
233-
parameters.Add(createParam(propType));
233+
// keep property type as nullable if it is
234+
var param = createParam(propertyInfo.PropertyType);
235+
236+
// copy all restrictions
237+
param.Attributes.AddRange(propertyInfo.Attributes.OfType<ValidationAttribute>());
238+
param.Attributes.AddRange(propertyInfo.Attributes.OfType<ItemsSourceAttribute>());
239+
240+
parameters.Add(param);
234241
}
235242
else if (propType.Is<IIndicator>())
236243
{

0 commit comments

Comments
 (0)