Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic annotate diagrams/shapes (Read 1477 times)
Shiju
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 7
Joined: Jun 29th, 2012
annotate diagrams/shapes
Jun 29th, 2012 at 1:26pm
Print Post  
Hi
     I am currently evaluating WPF diagram for my company. Is there any way i can annotate( add some comments ) in the diagram by clicking anywhere on the diagram?
   
    Also do you have more samples(including c# source code) for TreeLayouts and FlowChartlayouts?

thanks,
-Shiju
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: annotate diagrams/shapes
Reply #1 - Jun 29th, 2012 at 2:33pm
Print Post  
Hi,

There are no special annotation objects in the library. You could use ShapeNodes for that, and set their AllowIncoming / AllowOutgoingLinks properties to false in order to prevent users from drawing links to the annotations. So adding an annotation when the diagram is clicked could look like this:

Code
Select All
private void OnDiagramClicked(object sender, DiagramEventArgs e)
{
	if (e.MouseButton == MouseButton.Left)
	{
		var rect = new Rect(e.MousePosition, new Size(0, 0));
		rect.Inflate(40, 30);
		var annotation = diagram.Factory.CreateShapeNode(rect);
		diagram.BeginEdit(annotation);
	}
} 



Tree and Flowchart layouts are shown in the following samples: DirTree, JavaScript, TreeLayout. In addition, the custom layout code shown in WorkflowDesigner is what later became FlowchartLayout - you could use it as a base of your custom layout class to add support for more types of code statements.

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