Add support for selection prompt highlighting

This commit is contained in:
Nick
2021-01-15 14:23:09 +00:00
committed by GitHub
parent 1a747696a8
commit 63bae278a9
6 changed files with 52 additions and 6 deletions

View File

@ -35,6 +35,11 @@ namespace Spectre.Console
/// </summary>
public int PageSize { get; set; } = 10;
/// <summary>
/// Gets or sets the highlight style of the selected choice.
/// </summary>
public Style? HighlightStyle { get; set; }
/// <summary>
/// Gets or sets a value indicating whether or not
/// at least one selection is required.
@ -68,7 +73,7 @@ namespace Spectre.Console
var converter = Converter ?? TypeConverterHelper.ConvertToString;
var list = new RenderableMultiSelectionList<T>(console, Title, PageSize, Choices, converter);
var list = new RenderableMultiSelectionList<T>(console, Title, PageSize, Choices, converter, HighlightStyle);
using (new RenderHookScope(console, list))
{
console.Cursor.Hide();