Interface IFormComponentConfigurator
Represents a IFormComponent configurator which is used to configure a form component instance defined by FormComponentConfigurationAttribute.
public interface IFormComponentConfigurator
- Extension Methods
Remarks
This interface is for internal purposes only. To implement a custom configurator, use FormComponentConfigurator<TFormComponent> class instead.
Properties
DependencyFieldName
Name of the dependency field which will trigger the configurator when changed.
[Obsolete("Use DependencyFieldNames instead.")]
string DependencyFieldName { get; }
Property Value
- string
DependencyFieldNames
Names of the dependency fields which will trigger the configurator when changed.
IEnumerable<string> DependencyFieldNames { get; }
Property Value
- IEnumerable<string>
Methods
Configure(IFormComponent, IFormFieldValueProvider, CancellationToken)
Configures the form component.
Task Configure(IFormComponent formComponent, IFormFieldValueProvider formFieldValueProvider, CancellationToken cancellationToken)
Parameters
formComponentIFormComponentForm component to configure.
formFieldValueProviderIFormFieldValueProviderProvider of previous form field values.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
- Task
Remarks
This method can not be used to set value of form component. Use ConfigureValue(IFormFieldValueProvider, string, CancellationToken) instead.
ConfigureValue(IFormFieldValueProvider, string, CancellationToken)
Sets value of form component.
Task<object> ConfigureValue(IFormFieldValueProvider formFieldValueProvider, string changedFieldName, CancellationToken cancellationToken)
Parameters
formFieldValueProviderIFormFieldValueProviderProvider of previous form field values.
changedFieldNamestringName of the field whose change triggered the configurator, null if configurator was not triggered by field change.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
- Task<object>
Remarks
The value returned by this function will be set to the configured component.