Add support for selecting prompt items

Closes #447
This commit is contained in:
Patrik Svensson
2021-06-27 21:59:58 +02:00
committed by Phil Scott
parent fa553fd72e
commit 865552c3f2
8 changed files with 165 additions and 47 deletions

View File

@ -9,7 +9,7 @@ namespace Spectre.Console
public ListPromptItem<T>? Parent { get; }
public List<ListPromptItem<T>> Children { get; }
public int Depth { get; }
public bool Selected { get; set; }
public bool IsSelected { get; set; }
public bool IsGroup => Children.Count > 0;
@ -23,7 +23,7 @@ namespace Spectre.Console
public IMultiSelectionItem<T> Select()
{
Selected = true;
IsSelected = true;
return this;
}