Table of Contents

Method GetResult

Namespace
Terminal.Gui.App
Assembly
Terminal.Gui.dll

GetResult()

object? GetResult()

Returns

object

The result from the last run session, or null if no session has been run or the result was null.

GetResult<T>()

Gets the result from the last Run(IRunnable, Func<Exception, bool>?) or Run<TRunnable>(Func<Exception, bool>?, string?) call, cast to type T.

T? GetResult<T>() where T : class

Returns

T

The result cast to T, or null if the result is null or cannot be cast.

Type Parameters

T

The expected result type.

Examples

using (var app = Application.Create().Init())
{
    app.Run<ColorPickerDialog>();
    var selectedColor = app.GetResult<Color>();
    if (selectedColor.HasValue)
    {
        // Use the color
    }
}