Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How does some shapenodes move together? (Read 2043 times)
123danian
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Aug 27th, 2009
How does some shapenodes move together?
Oct 16th, 2009 at 8:20am
Print Post  
Hi
i am using shapenode in my silverlight application,
when i move one node, i want several other nodes moved together. but i found the shapenode class does not has a method just as like "attachto" in the netdiagram, so how can i do the same work without the "attachto" method?
can anyone help me ?

Thanks in advance.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How does some shapenodes move together?
Reply #1 - Oct 16th, 2009 at 10:52am
Print Post  
You will have to use a ContainerNode instead of ShapeNode. In the Silverlight version ContainerNode inherits from ShapeNode and can have a distinct shape too. Otherwise you could handle the NodeModifying event to move the other nodes in sync. with the modified one.
  
Back to top
 
IP Logged
 
123danian
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Aug 27th, 2009
Re: How does some shapenodes move together?
Reply #2 - Oct 19th, 2009 at 5:26am
Print Post  
hi,
ContainerNode cn = new ContainerNode(this.diagam);

cn.Children.Add(snA);
cn.Children.Add(snB);

When i first move the node cn, both node A,B moved toghther with it,  the second time i move the node cn, only one node moved together with it, finally, none node move together with the node cn,
i don't konw why,  would you help me ?  thank you very much.

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How does some shapenodes move together?
Reply #3 - Oct 19th, 2009 at 6:11am
Print Post  
Hi,

If the child nodes are not entirely inside the container, they might be removed from it after updating the container's position. Try setting ContainerNode.AllowRemoveChildren = false to prevent that.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint