From 70fc14e9cdb421d458a1c391c93445714620ee04 Mon Sep 17 00:00:00 2001 From: Patrik Svensson Date: Mon, 19 Oct 2020 20:34:46 +0200 Subject: [PATCH] Add new ctors for `Rows` and `Columns` widgets --- src/Spectre.Console/Widgets/Columns.cs | 11 ++++++++++- src/Spectre.Console/Widgets/Rows.cs | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/Spectre.Console/Widgets/Columns.cs b/src/Spectre.Console/Widgets/Columns.cs index 55c287c..0356428 100644 --- a/src/Spectre.Console/Widgets/Columns.cs +++ b/src/Spectre.Console/Widgets/Columns.cs @@ -25,7 +25,16 @@ namespace Spectre.Console /// /// Initializes a new instance of the class. /// - /// The items to render. + /// The items to render as columns. + public Columns(params IRenderable[] items) + : this((IEnumerable)items) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The items to render as columns. public Columns(IEnumerable items) { if (items is null) diff --git a/src/Spectre.Console/Widgets/Rows.cs b/src/Spectre.Console/Widgets/Rows.cs index 6de5c6d..b1c144e 100644 --- a/src/Spectre.Console/Widgets/Rows.cs +++ b/src/Spectre.Console/Widgets/Rows.cs @@ -19,7 +19,16 @@ namespace Spectre.Console /// /// Initializes a new instance of the class. /// - /// The children to render. + /// The items to render as rows. + public Rows(params IRenderable[] items) + : this((IEnumerable)items) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The items to render as rows. public Rows(IEnumerable children) { _children = new List(children ?? throw new ArgumentNullException(nameof(children)));