Class FieldModel
The resolved, ready-to-render form of a FieldSpec - component, label, height, validation, visibility/editability and the read-access gate - produced by CreateModel(FieldContext) and consumed by the edit components. The edit-view analog of ColumnModel.
public sealed record FieldModel : IEquatable<FieldModel>
- Inheritance
-
FieldModel
- Implements
- Inherited Members
Constructors
FieldModel(PropertyBinding, Type, Type?, string?, string?, Func<FieldContext, FieldModel, FieldHeight>, int?, PredicateResult, PredicateResult, IEnumerable<IFieldParameter>, bool)
public FieldModel(PropertyBinding binding, Type componentType, Type? labelComponentType, string? label, string? helpText, Func<FieldContext, FieldModel, FieldHeight> getRows, int? maxLength, PredicateResult visibility, PredicateResult editability, IEnumerable<IFieldParameter> parameters, bool isAdminOnly = false)
Parameters
bindingPropertyBindingcomponentTypeTypelabelComponentTypeTypelabelstringhelpTextstringgetRowsFunc<FieldContext, FieldModel, FieldHeight>maxLengthint?visibilityPredicateResulteditabilityPredicateResultparametersIEnumerable<IFieldParameter>isAdminOnlybool
Properties
Binding
public PropertyBinding Binding { get; init; }
Property Value
ComponentType
public Type ComponentType { get; init; }
Property Value
Editability
public PredicateResult Editability { get; init; }
Property Value
ExtraParameters
public IFieldParameter[] ExtraParameters { get; init; }
Property Value
GetRows
public Func<FieldContext, FieldModel, FieldHeight> GetRows { get; init; }
Property Value
HelpText
public string? HelpText { get; init; }
Property Value
IsAdminOnly
public bool IsAdminOnly { get; init; }
Property Value
IsReadOnly
public bool IsReadOnly { get; }
Property Value
IsVisible
public bool IsVisible { get; }
Property Value
Label
public string? Label { get; init; }
Property Value
LabelComponentType
public Type? LabelComponentType { get; init; }
Property Value
MaxLength
public int? MaxLength { get; init; }
Property Value
- int?
ReadAccessRequired
Entity type whose read permission gates this field, or null when ungated. Set from the field's RowSpec; enforced by the edit components via IsReadableBy(IPrincipal).
public IEntityInfo? ReadAccessRequired { get; init; }
Property Value
Visibility
public PredicateResult Visibility { get; init; }
Property Value
Methods
IsReadableBy(IPrincipal)
Whether principal has the read access this field requires - always true when the
field is ungated. Combined with IsVisible and the admin checks by the edit components.
public bool IsReadableBy(IPrincipal principal)
Parameters
principalIPrincipal
Returns
ResolveHeight(FieldContext)
Final height, modified for low-density vertical labelling.
public FieldHeight ResolveHeight(FieldContext context)
Parameters
contextFieldContext