Add support for markup text in panel header

This commit is contained in:
Patrik Svensson
2020-11-07 03:17:31 +01:00
committed by Patrik Svensson
parent be3350a411
commit b1da5e7ba8
12 changed files with 121 additions and 142 deletions

View File

@ -21,7 +21,7 @@ namespace BordersExample
static IRenderable CreatePanel(string name, BoxBorder border)
{
return new Panel($"This is a panel with\nthe [yellow]{name}[/] border.")
.Header($" {name} ", Style.Parse("blue"), Justify.Center)
.Header($" [blue]{name}[/] ", Justify.Center)
.Border(border)
.BorderStyle(Style.Parse("grey"));
}
@ -53,7 +53,7 @@ namespace BordersExample
table.AddRow("Cell", "Cell");
return new Panel(table)
.Header($" {name} ", Style.Parse("blue"), Justify.Center)
.Header($" [blue]{name}[/] ", Justify.Center)
.NoBorder();
}