Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Programmatically usage (Read 5791 times)
actionbase
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Mar 18th, 2009
Programmatically usage
Mar 18th, 2009 at 7:50am
Print Post  
I'm trying to build diagram programmatically. I created project like explained in Getting Started section of documentation. Then I write something like:

ShapeNode node = DiagramLite.CreateShapeNode(100, 100, 100, 100);

DiagramLite.Nodes.Add(node);

and run the project but can't see added nodes.

What am I doing wrong?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Programmatically usage
Reply #1 - Mar 18th, 2009 at 9:44am
Print Post  
Not sure, but you should either use the Factory method without calling Nodes.Add:

ShapeNode node = diag.Factory.CreateShapeNode(100, 100, 100, 100);

or use a constructor to create the node and call Nodes.Add:

ShapeNode node = new ShapeNode(100, 100, 100, 100);
diag.Nodes.Add(node);

Also make sure the diagram.Bounds rectangle is large enough to show the nodes at the coordinates you specify.

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


I love YaBB 1G - SP1!

Posts: 7
Joined: Mar 18th, 2009
Re: Programmatically usage
Reply #2 - Mar 18th, 2009 at 10:01am
Print Post  
Thanks, it worked. Another question: Who do I enable from code zoom functionality declared in component feature list?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Programmatically usage
Reply #3 - Mar 18th, 2009 at 11:15am
Print Post  
There is the ZoomFactor property, specifying zoom level in percents. You could change it from menu item, button or mouse-wheel event handler.

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


I love YaBB 1G - SP1!

Posts: 64
Joined: Feb 17th, 2009
Re: Programmatically usage
Reply #4 - Mar 18th, 2009 at 11:27am
Print Post  
You can also look at the Discussion topic:
"zoom method , how? "

This has example to use that and more insight provided earlier by Stoyan
  
Back to top
 
IP Logged
 
actionbase
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Mar 18th, 2009
Re: Programmatically usage
Reply #5 - Mar 18th, 2009 at 3:52pm
Print Post  
Does it mean that zoom is available on server-side only?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Programmatically usage
Reply #6 - Mar 18th, 2009 at 3:54pm
Print Post  
Why it should mean that? Just add a menu item or button to your Silverlight page and handle them on the client side by changing Diagram.ZoomFactor.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint