Proposal: Compile-time XAML-like UI for Terminal.Gui v2 #4713
Replies: 2 comments 2 replies
|
I think this is a wonderful concept and I strongly encourage you to pursue it. From my perspective at the very minimum something like this will either validate or invalidate a ton of the work that has gone into V2 around consistency and correctness across the API. I think just that would be wonderful. I've never really been one for hand coding markup to create apps and so I don't fully understand why someone want to use a layer like this without a designer. But that's just a personal preference. I'd like to see this as an add-on to the core framework like the designer and templates are. It would be great if this was just part of the gui-cs organization. I don't have much bandwidth right now to dive deep and do what you've done so far but as we approach beta, I'd be very curious to know if you have anything that you think will require a deep breaking change in the API. I'm working really hard right now trying to get the last big thing that's gonna impact the core API finished (command binding and routing) so we can declare beta. After that, I'd like us to hold a really high bar until 2.0 is released. |
|
Hi, Thank you for the encouragement — I appreciate it. I’m closely following the evolution of Terminal.Gui v2, and I’ve made solid progress on the code generation side of the project. My goal is to keep it aligned with the current API direction and avoid pushing it in a way that would constrain or complicate the core. Regarding the interest in markup without a designer: for me, the main value is structural consistency. Describing the interface in markup helps:
The generator then acts as a safety net. Instead of hand-writing repetitive layout and wiring code (which is easy to get subtly wrong), the structure is validated at build time and translated into explicit C#. Importantly, the generated code is fully debuggable:
So the intent is less about adding abstraction, and more about:
As you approach beta, I’ll keep an eye out for anything that feels like it would require a deep or breaking change in the core API. If I run into something that looks structural rather than incidental, I’ll raise it explicitly. I understand the importance of stabilizing the API before 2.0, so I’ll treat this project as exploratory and adaptable to whatever direction v2 ultimately settles on. Thanks again for the feedback. |
Uh oh!
There was an error while loading. Please reload this page.
Hi Terminal.Gui maintainers,
I’d like to start a discussion around an experimental side project related to Terminal.Gui v2, and get your feedback before going any further.
Context
Historically, there has been interest around describing Terminal.Gui UIs declaratively (for example with ReillyDigital.Terminal.Gui.Xaml). However:
At the same time, modern .NET UI stacks (MAUI, WinUI) have clearly moved toward compile-time UI generation, even though they still rely on runtime binding for value updates.
This led me to explore a similar idea for Terminal.Gui v2, but adapted to a TUI context.
The project
I created a small library named:
t2t-terminal-gui-xamllike
👉 https://github.com/tool2team/t2t-terminal-gui-xamllike
Key ideas:
InitializeComponent()style)Example goals:
Binding & refresh model (important distinction)
This project does not attempt to reproduce a MAUI/WPF binding engine.
Instead:
INotifyPropertyChangedBindablePropertyor a runtime binding engineSupported concepts:
TextField.Text ↔ VM.Property)The intent is closer to compiled XAML than to runtime XAML or dynamic UI loading, adapted to a TUI context.
Why I’m opening a discussion
At this stage, I’m not proposing a PR and I’m not assuming this belongs in the core repo.
What I’d like is:
your opinion on whether this approach makes sense in the Terminal.Gui ecosystem
feedback on API alignment with v2
guidance on whether this should:
I’m fully aware this is an additional abstraction layer, and I don’t want to push something that conflicts with the project’s philosophy.
Current status
Thanks for taking the time to read this. Even a short “yes/no/why” reaction would already be extremely valuable.
I’m happy to adapt the project, clarify details, or drop the idea entirely if it doesn’t align with Terminal.Gui’s direction.
Best regards,
Cédric — tool2team
All reactions