Terminal.Gui.Reflect 2.0.8

dotnet add package Terminal.Gui.Reflect --version 2.0.8
                    
NuGet\Install-Package Terminal.Gui.Reflect -Version 2.0.8
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Terminal.Gui.Reflect" Version="2.0.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Terminal.Gui.Reflect" Version="2.0.8" />
                    
Directory.Packages.props
<PackageReference Include="Terminal.Gui.Reflect" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Terminal.Gui.Reflect --version 2.0.8
                    
#r "nuget: Terminal.Gui.Reflect, 2.0.8"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Terminal.Gui.Reflect@2.0.8
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Terminal.Gui.Reflect&version=2.0.8
                    
Install as a Cake Addin
#tool nuget:?package=Terminal.Gui.Reflect&version=2.0.8
                    
Install as a Cake Tool

Terminal.Gui.Reflect

This project is an opinionated view framework for scalable Terminal.GUI apps

Acknowledgements

Authors

Features

  • PropertyGrid
    • A view that auto generates categories and properties
    • Each field supports validation
  • UniformGrid
    • A view similar to WPF's UniformGrid
  • InfoLabel
    • A label that shows a tooltip when hovered

Usage/Examples

PropertyGrid Example:


var hostBuilder = Host.CreateApplicationBuilder();
hostBuilder.Services.AddReflectServices();
hostBuilder.Services.AddOptions<AppSettings>();
hostBuilder.Services.AddSingleton(Application.Create().Init());

using var host = hostBuilder.Build();

await host.StartAsync();

var app = host.Services.GetRequiredService<IApplication>();
var viewControllerFactory = host.Services.GetRequiredService<IViewControllerFactory>();
var window = new Window
{
    Title = "Sample App"
};

window.Add(viewControllerFactory.Create<DefaultView>()); // use our IViewControllerFactory to initialize and autowire views

app.Run(window);

host.WaitForShutdown();

View / ViewModel Example

public class DefaultView : ViewController<FrameView, DefaultViewModel>
{
    private readonly Button _btn = new Button()
    {
        Text = "Click me!"
    };

    public override void InitializeComponents()
    {
        Root.Width  = Dim.Fill();
        Root.Height = Dim.Fill();
        Root.Text = "Default View";
        _btn.X      = Pos.Center();
        _btn.Y      = Pos.Center();
        _btn.MouseEvent += BtnOnMouseEvent; // hook to mouse events for this button

        Root.Add(_btn); // add our button to our root component

        AddCleanupOperation(() => _btn.MouseEvent -= BtnOnMouseEvent); // unhook event when cleaning up
    }

    private void BtnOnMouseEvent(object? sender, Mouse e)
    {
        if (e.IsPressed)    
        {
            ViewModel.Counter++; // when our button is clicked, increment the counter
        }
    }

    public override void SetupBindings()
    {
        // custom binding utility function
        Binding.TwoWay(ViewModel,                                          // view model
                       model => model.Counter,                             // property expression
                       _btn,                                               // ui element
                       builder => builder
                           .WithConvertIn(i => _btn.Text = $"Clicked {i}") // map the value
                           .Build())
                       .DisposeWith(this);                                 // cleanup
        
        // for basic bindings we use the Bind method instead
        // Bind(m => m.Counter, _label, l => l.Text)
    }
}

public class DefaultViewModel : INotifyPropertyChanged
{
    public int Counter
    {
        get;
        set
        {
            if (value == field)
            {
                return;
            }

            field = value;
            OnPropertyChanged();
        }
    }

    public event PropertyChangedEventHandler? PropertyChanged;

    protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null)
    {
        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
    }

    protected bool SetField<T>(ref T field, T value, [CallerMemberName] string? propertyName = null)
    {
        if (EqualityComparer<T>.Default.Equals(field, value)) return false;
        field = value;
        OnPropertyChanged(propertyName);
        return true;
    }
}
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.8 92 6/7/2026
2.0.7 97 6/6/2026
2.0.6 128 3/12/2026
2.0.5 141 3/12/2026
2.0.4 140 3/12/2026
2.0.2 135 3/12/2026
2.0.1 138 3/12/2026
2.0.0 144 3/11/2026
1.0.3 71 3/10/2026
1.0.2 132 3/10/2026
1.0.1 130 3/10/2026