Class EditScreenBase<TModel>.EditorMapping
- Namespace
- Dynamicweb.CoreUI.Screens
- Assembly
- Dynamicweb.CoreUI.dll
Defines the mapping metadata used to build an EditorBase for a model property on an edit screen.
protected record EditScreenBase<TModel>.EditorMapping : IEquatable<EditScreenBase<TModel>.EditorMapping>
- Inheritance
-
EditScreenBase<TModel>.EditorMapping
- Implements
- Inherited Members
Remarks
An EditScreenBase<TModel>.EditorMapping describes how an editor should be created and rendered:
- Name is the unique system name (typically the model property name).
- Dynamicweb.CoreUI.Screens.EditScreenBase<TModel>.EditorMapping.FallbackValue provides a value when the model does not supply one.
- ReadOnly / ReadOnlyPredicate control editor interactivity.
- Hidden / HiddenPredicate control editor visibility.
- Dynamicweb.CoreUI.Screens.EditScreenBase<TModel>.EditorMapping.EditorGenerator creates the concrete editor instance when needed. The mapping is evaluated at runtime against the current model to determine visibility, read-only state, and the actual editor to render.
Properties
Hidden
Gets a value indicating whether the editor should be hidden from the UI.
public bool Hidden { get; init; }
Property Value
Remarks
This flag is applied unconditionally. For model-dependent logic, use HiddenPredicate.
HiddenPredicate
Gets an optional predicate that determines visibility based on the current model instance.
public Func<TModel, bool>? HiddenPredicate { get; init; }
Property Value
Remarks
If provided, this predicate is evaluated at runtime; if it returns true, the editor is hidden.
Name
Gets the system name of the mapping. Typically corresponds to the model property's system name.
public string Name { get; init; }
Property Value
Remarks
This name is also assigned to the generated editor's Name to ensure consistent identification across configuration, validation, and persistence layers.
ReadOnly
Gets a value indicating whether the editor should be rendered in a read-only state.
public bool ReadOnly { get; init; }
Property Value
Remarks
This flag is applied unconditionally. For model-dependent logic, use ReadOnlyPredicate.
ReadOnlyPredicate
Gets an optional predicate that determines read-only state based on the current model instance.
public Func<TModel, bool>? ReadOnlyPredicate { get; init; }
Property Value
Remarks
If provided, this predicate is evaluated at runtime; if it returns true, the editor is read-only.