TerminalUI theming, Commands panel

This commit is contained in:
2023-08-15 20:23:58 +02:00
parent b792639635
commit d175c7bf7e
27 changed files with 604 additions and 77 deletions

View File

@@ -0,0 +1,32 @@
// See https://aka.ms/new-console-template for more information
using Microsoft.Extensions.DependencyInjection;
using TerminalUI;
using TerminalUI.Color;
using TerminalUI.DependencyInjection;
using TerminalUI.Examples.Controls;
using TerminalUI.Examples.Mocks;
using TerminalUI.Styling;
using TerminalUI.Styling.Controls;
Console.OutputEncoding = System.Text.Encoding.UTF8;
var services = new ServiceCollection()
.AddTerminalUi()
.AddSingleton<IRenderEngine, MockRenderEngine>();
IServiceProvider provider = services.BuildServiceProvider();
var applicationContext = provider.GetRequiredService<IApplicationContext>();
applicationContext.Theme = new Theme
{
ControlThemes = new ControlThemes
{
ProgressBar = new ProgressBarTheme
{
ForegroundColor = ConsoleColors.Foregrounds.Blue
}
}
};
Console.CursorVisible = false;
new ProgressBarExamples(applicationContext).LoadingExample();
Console.CursorVisible = true;