Panel Class
A renderable panel.
public sealed class Panel : Renderable, IRenderable, IHasBoxBorder, IHasBorder, IExpandable,
IPaddable
- Namespace
- Spectre
.Console - Interfaces
- Base Types
Constructors
-
Panel
(IRenderable) -
Initializes a new instance of the
Panel
class. -
Panel
(string) -
Initializes a new instance of the
Panel
class.
Properties
- BoxBorder Border
- Gets or sets the box.
- Style BorderStyle
- Gets or sets the box style.
- bool Expand
-
Gets or sets a value indicating whether or not the panel should
fit the available space. If
false
, the panel width will be auto calculated. Defaults tofalse
. - PanelHeader Header
- Gets or sets the header.
- int? Height
- Gets or sets the height of the panel.
- Padding? Padding
- Gets or sets the padding.
- bool UseSafeBorder
- Gets or sets a value indicating whether or not to use a "safe" border on legacy consoles that might not be able to render non-ASCII characters.
- int? Width
- Gets or sets the width of the panel.
Methods
-
protected override Measurement Measure
(RenderOptions, int) - Measures the renderable object.
-
protected override IEnumerable<Segment> Render
(RenderOptions, int) - Renders the object.
Extension Methods
-
T AsciiBorder
<Panel> () - Display an ASCII border.
-
T Border
<Panel> (BoxBorder) - Sets the border.
-
T BorderColor
<Panel> (Color) - Sets the border color.
-
T BorderStyle
<Panel> (Style) - Sets the border style.
-
T Collapse
<Panel> () - Tells the specified object to not expand to the available area but take as little space as possible.
-
T DoubleBorder
<Panel> () - Display a double border.
-
T Expand
<Panel> () - Tells the specified object to expand to the available area.
-
IEnumerable<Segment> GetSegments
(IAnsiConsole) - Gets the segments for a renderable using the specified console.
-
Panel Header
(PanelHeader) - Sets the panel header.
-
Panel Header
(string, Justify?) - Sets the panel header.
-
Panel HeaderAlignment
(Justify) - Sets the panel header alignment.
-
T HeavyBorder
<Panel> () - Display a heavy border.
-
T NoBorder
<Panel> () - Do not display a border.
-
T NoSafeBorder
<Panel> () - Disables the safe border.
-
T PadBottom
<Panel> (int) - Sets the bottom padding.
-
T Padding
<Panel> (int, int, int, int) - Sets the left, top, right and bottom padding.
-
T Padding
<Panel> (int, int) - Sets the horizontal and vertical padding.
-
T Padding
<Panel> (Padding) - Sets the padding.
-
T PadLeft
<Panel> (int) - Sets the left padding.
-
T PadRight
<Panel> (int) - Sets the right padding.
-
T PadTop
<Panel> (int) - Sets the top padding.
-
T RoundedBorder
<Panel> () - Display a rounded border.
-
T SafeBorder
<Panel> () - Enables the safe border.
-
T SquareBorder
<Panel> () - Display a square border.