Mindmap Sample : ToggleChildrenVisibilityRecursively method

2 posts, 0 answers
  1. Robert
    Robert avatar
    17 posts
    Member since:
    Jun 2012

    Posted 29 Jun 2012 Link to this post

    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
  2. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 04 Jul 2012 Link to this post

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

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top