Fix issue 1153 on expanded tree

This commit is contained in:
Davide Piccinini 2023-06-21 21:00:53 +02:00 committed by Patrik Svensson
parent 3437130bf0
commit 156d254208

View File

@ -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.