This is a migrated thread and some comments may be shown as answers.

Mindmap Sample : ToggleChildrenVisibilityRecursively method

1 Answer 44 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 29 Jun 2012, 08:48 PM
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 :

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

1 Answer, 1 is accepted

Sort by
0
Zarko
Telerik team
answered on 04 Jul 2012, 01:38 PM
Hello Robert,
Thank you for the feedback. It really seems that we've forgotten for this verification and we'll make sure to fix this for the SP.
I've updated your telerik account and if you have further questions or suggestions feel free to share.

All the best,
Zarko
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Diagram
Asked by
Robert
Top achievements
Rank 1
Answers by
Zarko
Telerik team
Share this question
or