Class
FormDialog<T>
ConsoleMonster.Interactive
A modal form composed from ordinary named inputs, with validation and a typed result.
Inheritance
- object
- FormDialog<T>
Usage
Explore 2 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 1
- Method FormDialogOptions.Build
Accepted by parameters 1
- Method AppDialogs.Show``1
Type Parameters
- T
Constructors
public FormDialog<T>(string title, IWidget content, Func<AppState, T?> result) #Creates a form. The result callback runs on the app thread after validation.
Parameters
- title string
- content ConsoleMonster.Layout.IWidget
- result System.Func<ConsoleMonster.Interactive.AppState, T?>
Inherited Methods
Properties
public Func<AppState, T?> Result { get; } #Maps committed field values to the result.
public Func<AppState, string?>? Validate { get; set; } #Returns an error to keep the form open, or null to accept.
public bool DefaultAccept { get; set; } #Whether Enter initially chooses the affirmative button. False defaults to Cancel.
public string? InitialFocus { get; set; } #Optional field key to focus initially instead of the default button.