Hello,
I am using the dll from
https://mindfusion.eu/_beta/diaglite_containers2.zip .
With the code below, I have the container node and Shape node arranged side by side. The layout class should respect the containment.
Even without the layout class, I am able to drag a node outside of the container class. I assume there is a work around to prevent this, but the basic design should be the child must stay within the boundaries of the parent.
Any fix release for this ?
private void EncSeqDiag_Loaded(object sender, RoutedEventArgs e)
{
ContainerNode Parent1 = new ContainerNode(DiagramLite);
DiagramLite.Nodes.Add(Parent1);
Parent1.Bounds = new Rect(10, 10, 200, 100);
ContainerNode Parent2 = new ContainerNode(DiagramLite);
DiagramLite.Nodes.Add(Parent2);
Parent2.Bounds = new Rect(10, 10, 200, 100);
DiagramLite.ShapeBrush = new SolidColorBrush(Color.FromArgb(50, 0, 128, 192));
for (int i = 0; i < 20; i++)
{
ShapeNode node = new ShapeNode(DiagramLite);
node.Shape = Shape.Shapes["Ellipse"];
node.Pen = new Pen(new SolidColorBrush(Colors.Black));
node.Text = "node " + i;
DiagramLite.Nodes.Add(node);
Parent1.Children.Add(node);
}
for (int i = 21; i < 40; i++)
{
ShapeNode node = new ShapeNode(DiagramLite);
node.Shape = Shape.Shapes["Ellipse"];
node.Pen = new Pen(new SolidColorBrush(Colors.Black));
node.Text = "node " + i;
DiagramLite.Nodes.Add(node);
Parent2.Children.Add(node);
}
Perform_Layout();
}
private void Perform_Layout()
{
var layout = new MindFusion.Diagramming.Silverlight.Layout.SpringLayout();
layout.Arrange(DiagramLite);
}
regards.