Made the tree view remember the open state close state
This commit is contained in:
parent
d1adc0cb72
commit
b23db9f1e1
3 changed files with 14 additions and 2 deletions
|
|
@ -91,6 +91,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
|
|||
expandWidget.Click += (s, e) =>
|
||||
{
|
||||
this.Expanded = !this.Expanded;
|
||||
this.ExpandedChanged?.Invoke(this, null);
|
||||
expandWidget.Expanded = this.Expanded;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -113,9 +113,20 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
if (parentNode != null)
|
||||
{
|
||||
parentNode.Nodes.Add(node);
|
||||
parentNode.Expanded = true;
|
||||
if(parentNode.Tag is IObject3D object3D)
|
||||
{
|
||||
parentNode.Expanded = object3D.Expanded;
|
||||
}
|
||||
}
|
||||
|
||||
node.ExpandedChanged += (s, e) =>
|
||||
{
|
||||
if (item.Source is Object3D object3D)
|
||||
{
|
||||
object3D.Expanded = node.Expanded;
|
||||
}
|
||||
};
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 24c7898f669faf5e407c13514407a781647b8706
|
||||
Subproject commit 1d7b58a427bef7e48583a59b6c4483276f4a9ce0
|
||||
Loading…
Add table
Add a link
Reference in a new issue