Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Custom nodes as on Tutorial 3 (Read 1684 times)
baba
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Jan 20th, 2010
Custom nodes as on Tutorial 3
Jan 20th, 2010 at 3:09pm
Print Post  
Hi,
I'm using the trial version as my company decided to use your library to provide diagram-design functionalities in our software products.

What I am trying to do: basically I'd need something very similar to what you do in Tutorial3 but I'm in troubles with UI as, even in Tutorial3, nodes are created as ShapeNode type when the user drags the mouse over an empty region, right?

I instead need the node to be created as, following the Tutorial3 scenario, as an OrgChartNode.

What should I do to reach this result?

Is there an alternative way to adorn the ShapeNode as I need? I've tried to apply the generic.xaml template to the type ShapeNode but nothing changes... I'm now trying the code-behind way.... but I am running out of ideas.... Can you help please?

Cheers,
baba.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Custom nodes as on Tutorial 3
Reply #1 - Jan 20th, 2010 at 3:22pm
Print Post  
Hi,

Assign an instance of this class to diagram.CustomBehavior:

Code
Select All
public class OrgChartBehavior : LinkNodesBehavior
{
	public OrgChartBehavior(Diagram diagram) : base(diagram) {}

	protected override DiagramNode CreateNode()
	{
		return new OrgChartNode();
	}
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
baba
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Jan 20th, 2010
Re: Custom nodes as on Tutorial 3
Reply #2 - Jan 20th, 2010 at 3:44pm
Print Post  
Stoyo wrote on Jan 20th, 2010 at 3:22pm:
Hi,

Assign an instance of this class to diagram.CustomBehavior:

<snip>

I hope that helps,
Stoyan


It helped A LOT, thanks! Smiley

Cheers,
baba.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint