MvcDiagram version 4.1 contains the following new features and improvements -
Multiple labels per nodeThe NodeLabel class allows multiple captions to be displayed for a single DiagramNode of any type. Node labels provide a set of properties allowing full customization of their display and positioning. Label position is defined by specifying a pin point and offset from it, set through SetCornerPosition, SetEdgePosition, SetCenterPosition methods. In addition, the HorizontalAlign and VerticalAlign properties of NodeLabel specify on which side of pin point to draw the label's caption.
For example, following code adds extra labels to top-left and bottom-right corners of a ShapeNode:
var node = diagram.Factory.CreateShapeNode(10, 50, 40, 30);
node.Text = "text"; // centered main text
var lb1 = node.AddLabel("label 1");
lb1.SetCornerPosition(0, 0, 0);
lb1.HorizontalAlign = StringAlignment.Near;
lb1.VerticalAlign = StringAlignment.Near;
lb1.Brush = new SolidBrush(Color.Red);
lb1.TextBrush = new SolidBrush(Color.White);
var lb2 = node.AddLabel("label 2");
lb2.SetCornerPosition(2, 0, 0);
lb2.HorizontalAlign = StringAlignment.Far;
lb2.VerticalAlign = StringAlignment.Far;
lb2.Brush = new SolidBrush(Color.Yellow);
lb2.TextBrush = new SolidBrush(Color.Red);
Multi-touch improvements- The multiTouchDraw property of DiagramView lets you prevent drawing multiple items simultaneously, while keeping other multitouch gestures enabled.
- The handleTouchHitDistance property of DiagramView makes it easier to grab adjustment handles on mobile devices, without increasing the adjustmentHandlesSize value.
Miscellaneous- The MoveLabels behavior lets user move link and node labels interactively.
- HorizontalOffset and VerticalOffset now work for link labels positioned using SetLinkLengthPosition method.
- ExcelExporter exports pen width of links.
- ExcelExporter sets more precise positions of link end points.
- LinkEventArgs now includes origin and destination properties that report respective candidate nodes to linkCreating and linkModifying client-side event handlers.
- SvgNode.ContentAlign property specifies alignment of SVG drawing inside the node.
- DiagramLink.lineAlignment property sets the vertical position of link's text.
- Horizontal scroll gestures should now work on Macbook trackpad when using virtual scroll mode.
If anyone is interested in trying the beta version, please download this archive containing updated assembly files -
https://mindfusion.eu/_beta/MvcDiagram.4.1.Core.zipAny comments, questions and general feedback are welcome.