mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-15 00:12: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>
|
/// </summary>
|
||||||
public List<TreeNode> Nodes => _root.Nodes;
|
public List<TreeNode> Nodes => _root.Nodes;
|
||||||
|
|
||||||
|
private bool _expanded { get; set; } = true;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value indicating whether or not the tree is expanded or not.
|
/// Gets or sets a value indicating whether or not the tree is expanded or not.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool Expanded { get; set; } = true;
|
public bool Expanded
|
||||||
|
{
|
||||||
|
get => _expanded;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_expanded = value;
|
||||||
|
_root.Expand(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="Tree"/> class.
|
/// Initializes a new instance of the <see cref="Tree"/> class.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user