//To change the Spacing properties /// <summary> /// HorizontalSpacing ,VerticalSpacing and SpaceBetweenSubTrees /// Description: /// Provide the spaces between the edges of the adjacent nodes (Siblings)[HorizontalSpacing]. /// Provide spaces between the nodes that lie at the next levels of the layout[VerticalSpacing]. /// Provide the sthe spaces between adjacent Subtrees[SpaceBetweenSubTrees]. /// Property of DiagramModel /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void TextBox_TextChanged(object sender, TextChangedEventArgs e) { TextBox box = (sender as TextBox); DirectedTreeLayout dtlayout = new DirectedTreeLayout(diagramModel, diagramView); if (diagramModel != null) { if (box.Text != string.Empty) { switch (box.Name) { case "Hspace": diagramModel.HorizontalSpacing = double.Parse(box.Text); dtlayout.RefreshLayout(); break; case "Vspace": diagramModel.VerticalSpacing = double.Parse(box.Text); dtlayout.RefreshLayout(); break; case "Sspace": diagramModel.SpaceBetweenSubTrees = double.Parse(box.Text); dtlayout.RefreshLayout(); break; } } } }
//Refresh the Layout private void refershLayout(TreeOrientation treeorientation) { DirectedTreeLayout tree = new DirectedTreeLayout(diagramModel, diagramView); diagramModel.Orientation = treeorientation; tree.RefreshLayout(); }
//Refreshing the Layout private void refershLayout(TreeOrientation treeorientation) { DirectedTreeLayout tree = new DirectedTreeLayout(diagramModel, diagramView); diagramModel.Orientation = treeorientation; tree.RefreshLayout(); (diagramView.Page as DiagramPage).InvalidateMeasure(); (diagramView.Page as DiagramPage).InvalidateArrange(); }