WpfDiagram version 3.8.2 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(30, 70, 80, 60);
node.Text = "text"; // centered main text
var lb1 = node.AddLabel("label 1");
lb1.SetCornerPosition(0, 0, 0);
lb1.TextAlignment = TextAlignment.Left;
lb1.TextVerticalAlignment = AlignmentY.Top;
lb1.Brush = Brushes.Red;
lb1.TextBrush = Brushes.White;
lb1.Margin = new Thickness(4);
lb1.TextPadding = new Thickness(0);
var lb2 = node.AddLabel("label 2");
lb2.SetCornerPosition(2, 0, 0);
lb2.TextAlignment = TextAlignment.Right;
lb2.TextVerticalAlignment = AlignmentY.Bottom;
lb2.Brush = Brushes.Yellow;
lb2.TextBrush = Brushes.Red;
Export improvements- New Export overloads of exporter classes allow writing to System.IO.Stream.
- ExcelExporter exports pen width of links.
- ExcelExporter sets more precise positions of link end points.
Miscellaneous- The MoveLabels behavior lets user move link and node labels interactively.
- HorizontalOffset and VerticalOffset now work for link labels positioned using SetLinkLengthPosition method.
If anyone is interested in trying the beta version, please download this archive containing updated assembly files -
https://mindfusion.eu/_beta/wpfdiag382.zipAny comments, questions and general feedback are welcome.