Made the tree view remember the open state close state

This commit is contained in:
Lars Brubaker 2018-12-11 16:20:42 -08:00
parent d1adc0cb72
commit b23db9f1e1
3 changed files with 14 additions and 2 deletions

View file

@ -91,6 +91,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
expandWidget.Click += (s, e) => expandWidget.Click += (s, e) =>
{ {
this.Expanded = !this.Expanded; this.Expanded = !this.Expanded;
this.ExpandedChanged?.Invoke(this, null);
expandWidget.Expanded = this.Expanded; expandWidget.Expanded = this.Expanded;
}; };

View file

@ -113,9 +113,20 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
if (parentNode != null) if (parentNode != null)
{ {
parentNode.Nodes.Add(node); 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; return node;
} }

@ -1 +1 @@
Subproject commit 24c7898f669faf5e407c13514407a781647b8706 Subproject commit 1d7b58a427bef7e48583a59b6c4483276f4a9ce0