Class PromptExtensions
Extension methods for prompting users with views in modal dialogs.
public static class PromptExtensions
- Inheritance
-
PromptExtensions
- Inherited Members
Remarks
These extensions provide convenient ways to show any View in a modal dialog with Ok/Cancel buttons and get a typed result.
Two API styles are provided:
<ul><li>
<xref href="Terminal.Gui.Views.PromptExtensions.Prompt%60%602(Terminal.Gui.App.IRunnable%2c%60%600%2cSystem.Func%7b%60%600%2c%60%601%7d%2c%60%601%2cSystem.Action%7bTerminal.Gui.Views.Prompt%7b%60%600%2c%60%601%7d%7d)" data-throw-if-not-resolved="false"></xref>
on <xref href="Terminal.Gui.App.IRunnable" data-throw-if-not-resolved="false"></xref> - For C# with type-safe result extraction and hosting relationship
</li><li>
<xref href="Terminal.Gui.Views.PromptExtensions.Prompt%60%601(Terminal.Gui.App.IApplication%2c%60%600)" data-throw-if-not-resolved="false"></xref>
on <xref href="Terminal.Gui.App.IApplication" data-throw-if-not-resolved="false"></xref> - For scripting languages, returns string?.
</li></ul>
For detailed usage patterns, customization options, and PowerShell examples, see the Prompt Deep Dive.
Methods
- Prompt<TView>(IApplication, TView)
Shows a view in a modal dialog with Ok/Cancel buttons. For scripting languages.
- Prompt<TView, TResult>(IRunnable, TView?, Func<TView, TResult?>?, TResult?, Action<Prompt<TView, TResult>>?)
Shows a view in a modal dialog with Ok/Cancel buttons and extracts a typed result.