Slavcho wrote on Aug 14
th, 2008 at 11:33am:
There is, use the AttachTo method. For example
int pc = link.ControlPoints.Count;
Point linkCenter = new Point(link.ControlPoints[pc/2 - 1], link.ControlPoints[pc/2];
ShapeNode label = diag.Factory.CreateShapeNode(linkCenter, labelSize);
label.Text = "link's label";
label.Transparent = true;
label.IgnoreLayout = true;
label.AttachTo(link, AttachToLink.Segment, link.SegmentCount / 2);
HTH
Using this method I get the following issue when using the Orthogonal Layout:
Any ideas?
System.ArgumentOutOfRangeException occurred
Message="Index was out of range. Must be non-negative and less than the size of the collection.\r\nParameter name: index"
Source="mscorlib"
ParamName="index"
StackTrace:
at System.Collections.CollectionBase.System.Collections.IList.get_Item(Int32 index)
at MindFusion.Diagramming.Wpf.PointCollection.get_Item(Int32 index)
at MindFusion.Diagramming.Wpf.Group.xcac3bd22cf22296d(Attachment xe3b5f8a78f422902)
at MindFusion.Diagramming.Wpf.Group.x9402138a43a773c1(InteractionState x01b557925841ae51, Boolean xfab68f3923c9249c)
at MindFusion.Diagramming.Wpf.Group.x9402138a43a773c1(InteractionState x01b557925841ae51)
at MindFusion.Diagramming.Wpf.DiagramLink.x0d5905a18dc24aa7(Boolean x1c5ff8c3c1ac16ad)
at MindFusion.Diagramming.Wpf.DiagramLink.UpdateFromPoints(Boolean updateGroups)
at MindFusion.Diagramming.Wpf.DiagramLink.UpdateFromPoints()
at MindFusion.Layout.xdb1b7acfd02f3e95.x0360c0152e0fc04b(DiagramLink xe9c763083b68a7ee, PointCollection x6fa2570084b2ad39)
at MindFusion.Layout.xdb1b7acfd02f3e95.x3d8c55d85ef1a2ec(DiagramLink xe9c763083b68a7ee, Boolean xc2bb3863aee458e5, Boolean x3f77266add946953)
at MindFusion.Diagramming.Wpf.Layout.OrthogonalLayout.Arrange(Diagram diagram, DiagramItemCollection items)
at MindFusion.Diagramming.Wpf.Layout.Layout.Arrange(Diagram diagram)
at Paragon.SSRM.UI.WiringDiagramControl.ApplyLayout() in D:\Local Repositories\Paragon DotNet\SSRM\trunk\Ssrm\UI\WiringDiagramControl.xaml.cs:line 229
InnerException: