Hi,
It seems that a bug has slipped into the ToggleChildrenVisibilityRecursively method.
Indeed, this method doesn't take into account the property AreChildrenVisible value of the connection target. So even if a shape is declared as collapsed, when a shape parent is expanded, this child shape is also expanded. Unfortunately, the togglebutton doesn't indicate this state.
Below, a proposed solution :
Keep up the good work
Robert
It seems that a bug has slipped into the ToggleChildrenVisibilityRecursively method.
Indeed, this method doesn't take into account the property AreChildrenVisible value of the connection target. So even if a shape is declared as collapsed, when a shape parent is expanded, this child shape is also expanded. Unfortunately, the togglebutton doesn't indicate this state.
Below, a proposed solution :
private
void
ToggleChildrenVisibilityRecursively(Visibility nextVisibility, IShape shape)
{
foreach
(var connection
in
this
.ParentDiagram.GetOutgoingConnectionsForShape(shape))
{
connection.Visibility = nextVisibility;
if
(!shape.Equals(connection.Target) && connection.Target !=
null
)
{
connection.Target.Visibility = nextVisibility;
var l_mindshapeTarget = connection.Target
as
MindmapShapeBase;
if
(nextVisibility == System.Windows.Visibility.Visible && l_mindshapeTarget !=
null
&& !l_mindshapeTarget.AreChildrenVisible)
{
continue
;
}
this
.ToggleChildrenVisibilityRecursively(nextVisibility, connection.Target);
}
}
}
Keep up the good work
Robert