API Reference
Class
ChoiceField
One or several values from a list, given up front or loaded asynchronously from the values of the fields it depends on (choosing a site loads its servers): a spinner shows while loading, and loading can be cancelled.
Inheritance
- Field
- ChoiceField
Usage
Explore 4 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 4
- Method Form.MultiSelect
- Method Form.Select
- Method FormPage.MultiSelect
- Method FormPage.Select
Constructors
public ChoiceField(String name, String? label = null, Boolean multiple = false) #Creates a choice field.
Parameters
- name System.String
- The key.
- label System.String? = null
- The label.
- multiple System.Boolean = false
- Whether several values can be chosen.
Methods
public override String Display(Object? value, PromptLabels labels) #Returns:
StringThe value as shown in the form and on the review page.
Parameters
- value System.Object?
- The value.
- labels ConsoleMonster.Interactive.PromptLabels
- The labels.
Returns
The text.
Inherited Methods
public virtual Boolean Equals(Object? obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object?
Properties
public IList<Choice> Choices { get; } #The choices (replaced by the loader's result when one is set).
public Func<FormValues, CancellationToken, Task<IEnumerable<Choice>>>? Loader { get; set; } #Loads the choices from the current values (dependent fields).
public Func<Choice, IWidget?>? Preview { get; set; } #Preview content for the focused choice in the editor.