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

@ -20,16 +20,14 @@ namespace PanelExample
new Panel(new Text("Left adjusted\nLeft").LeftAligned())
.Expand()
.SquareBorder()
.Header("Left")
.HeaderStyle("red"));
.Header("[red]Left[/]"));
// Centered ASCII panel with text
AnsiConsole.Render(
new Panel(new Text("Centered\nCenter").Centered())
.Expand()
.AsciiBorder()
.Header("Center")
.HeaderStyle("green")
.Header("[green]Center[/]")
.HeaderAlignment(Justify.Center));
// Right adjusted, rounded panel with text
@ -37,8 +35,7 @@ namespace PanelExample
new Panel(new Text("Right adjusted\nRight").RightAligned())
.Expand()
.RoundedBorder()
.Header("Right")
.HeaderStyle("blue")
.Header("[blue]Right[/]")
.HeaderAlignment(Justify.Right));
}
}