mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-13 15:42:50 +08:00
Fix issue 1153 on expanded tree
This commit is contained in:
parent
3437130bf0
commit
156d254208
@ -23,10 +23,19 @@ public sealed class Tree : Renderable, IHasTreeNodes
|
||||
/// </summary>
|
||||
public List<TreeNode> Nodes => _root.Nodes;
|
||||
|
||||
private bool _expanded { get; set; } = true;
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether or not the tree is expanded or not.
|
||||
/// </summary>
|
||||
public bool Expanded { get; set; } = true;
|
||||
public bool Expanded
|
||||
{
|
||||
get => _expanded;
|
||||
set
|
||||
{
|
||||
_expanded = value;
|
||||
_root.Expand(value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Tree"/> class.
|
||||
|
Loading…
x
Reference in New Issue
Block a user