Class SwitchInputField<T>
Represents a switch input field in Trinity.
public class SwitchInputField<T> : TrinityField<SwitchInputField<T>, T>, ITrinityComponent, ITrinityField, IFormComponent
Type Parameters
T
The type of the value to be stored in the switch input field.
- Inheritance
-
TrinityComponent<SwitchInputField<T>, T>TrinityField<SwitchInputField<T>, T>SwitchInputField<T>
- Implements
- Derived
- Inherited Members
Constructors
SwitchInputField(string)
public SwitchInputField(string columnName)
Parameters
columnName
string
Properties
ComponentName
The component name in the front-end side.
public override string ComponentName { get; }
Property Value
FalseValue
Gets or sets the value to be stored in the switch input field when the switch is turned off.
public T? FalseValue { get; protected set; }
Property Value
- T
TrueValue
Gets or sets the value to be stored in the switch input field when the switch is turned on.
public T? TrueValue { get; protected set; }
Property Value
- T
Methods
SetTrueFalseValue(T, T)
Sets the values to be stored in the switch input field when the switch is turned on and off, respectively.
public SwitchInputField<T> SetTrueFalseValue(T trueValue, T falseValue)
Parameters
trueValue
TThe value to be stored when the switch is turned on.
falseValue
TThe value to be stored when the switch is turned off.
Returns
- SwitchInputField<T>
The SwitchInputField<T> instance.