一个用于 C# 控制台应用程序的 GUI 框架
ConsoleGUI 是一个简单的基于布局的 .NET 框架,用于创建基于控制台的 GUI 应用程序。 它提供了最基本的布局管理工具以及一组基本控件。 上述示例实际上并不是一个可玩的国际象棋游戏。左侧的棋盘只是一个带有文本的网格 - 它仅用于展示目的。当然,在背后添加一些代码后,就可以使其具有交互性了。
此框架不依赖平台和依赖项。该库针对 .NET 标准 2.0,在 Windows 和 Linux 机器上都可以正常运行。
与其他提供类似功能的项目相比,本库的独特之处在于 ConsoleGUI 框架完全基于布局驱动。在这方面,它更像是 WPF 或 HTML,而不是 Windows Forms 等。您不需要指定特定的坐标,而是让堆栈面板、托盘面板和其他布局管理器完成工作。我并不声称这是做事的正确方式,这只是我背景的体现。有关此项目的更多详细信息(以及一个工作示例的概览),请参阅以下视频: https://youtu.be/YIrmjENTaaU
最后设置 ConsoleManager:
// optional: adjusts the buffer size and sets the output encoding to the UTF8
ConsoleManager.Setup();
// optional: resizes the console window (the size is set in a number of characters, not pixels)
ConsoleManager.Resize(new Size(150, 40));
// sets the main layout element and prints it on the screen
ConsoleManager.Content = new TextBlock { Text = "Hello world" };暂无开放 Issues,或尚未同步最近议题。