Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Anchoring nodes inside containers (Read 2881 times)
mihai
Junior Member
**
Offline



Posts: 86
Joined: Jul 29th, 2009
Anchoring nodes inside containers
Aug 6th, 2014 at 7:34am
Print Post  
Hi,

Is there support to anchor child nodes inside container nodes, so that they potentially resize with the container? That is, similar to Control.Anchor in WinForms.

Thanks,
-Mihai
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Anchoring nodes inside containers
Reply #1 - Aug 6th, 2014 at 8:38am
Print Post  
Hi,

There's support for that in the Group class used by Containers to manage their children. We'll add an Add(GroupAnchorStyles) overload for next release to let you create respective type of grouping. For time being you could use child.AttachTo(container,GroupAnchorStyles) method, but it won't support some container features, such as folding.

Stoyan
  
Back to top
 
IP Logged
 
mihai
Junior Member
**
Offline



Posts: 86
Joined: Jul 29th, 2009
Re: Anchoring nodes inside containers
Reply #2 - Aug 7th, 2014 at 9:14am
Print Post  
Understood. Thanks Stoyan, on both counts.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Anchoring nodes inside containers
Reply #3 - Aug 14th, 2014 at 11:19am
Print Post  
Hi,

This version implements a ContainerNode.Add(GroupAnchorStyles) overload:
https://mindfusion.eu/_beta/wpfdiag_ctranchor.zip

You can use it like this to anchor to lower right corner for example:
Code
Select All
var ctr = diagram.Factory.CreateContainerNode(10, 10, 200, 200);
ctr.EnabledHandles = AdjustmentHandles.All;
ctr.HandlesStyle = HandlesStyle.DashFrame;

var node = diagram.Factory.CreateShapeNode(120, 120, 50, 50);
ctr.Add(node, GroupAnchorStyles.Right | GroupAnchorStyles.Bottom); 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
mihai
Junior Member
**
Offline



Posts: 86
Joined: Jul 29th, 2009
Re: Anchoring nodes inside containers
Reply #4 - Aug 22nd, 2014 at 8:13am
Print Post  
Nice, thanks Stoyan!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint