Search
Version History

The list below describes past changes and additions to WpfDiagram:

New in version 3.9.3

New in version 3.9.2

  • Fix for missing segment joints when drawing thick links with LinkCrossings enabled.
  • Link crossing decorations are now also drawn over a control point if it is collinear with adjacent control points.
  • Fix for Arrange method of ContainerNode not applying layout.
  • Arrange method of ContainerNode now adds offset for CaptionHeight; adjusting for caption through layout's Margins is no longer necessary.
  • Fix for hyphens offsetting text vertically in exported SVG.
  • FromFile and FromStream static methods added to SvgContent let you load SVG drawings with less code.
  • SvgContent path parser fixes for missing delimiters and S commands.
  • Fix for LinksSource changes not repainting immediately.
  • RealizeItems method added to VirtualizingDiagram lets you create actual items in specified off-screen area.
  • VirtualizingDiagram fix for new ContainerNode design.
  • New CopySelection overload lets you copy a list of items without selecting them.

New in version 3.9.1

  • The ValidateLinkCrossing event validates visibility of individual link crossing point decorations.
  • TableNode now displays the tooltips of its row anchor points.
  • TableNode now clips anchor points of rows scrolled outside current table viewport.
  • Fixed SVG sub-path rendering in SvgNode.
  • Improved text positioning for nodes with large fonts in exported SVG files.
  • SvgNode stroke thickness fixes.
  • New Arrange overload of base Layout class allows arranging a subgraph of VirtualizingDiagram.
  • Fixed ChangeItemCmd exception when saving DiagramLink properties.
  • MoveShades mode no longer resets custom Opacity values to 1 after the interaction.

New in version 3.9

Pattern router

New PatternRouter class routes links by applying patterns of segment and turn sequences and accepting them when resulting paths do not cross nodes. A path is accepted if its final segment ends in target point and is orthogonal to respective side of target node. If there are several possible paths, the router selects the shortest one. The MinimumDistance property specifies minimum allowed distance of link segments from nodes. The PreferredDistance property specifies distance of first or last link bend from associated node. PatternRouter includes several predefined patterns designed to create consistent-looking paths, and allows creation of custom patterns. Custom patterns can be defined as sequence of RouteStep objects specifying whether the path advances by relative or absolute distance, or changes direction:

C#  Copy Code

var rightZigzag = new RoutePattern();
rightZigzag.Steps.Add(
 new RouteStep(RouteStepKind.AdvanceRelative, 0.5f));
rightZigzag.Steps.Add(
 new RouteStep(RouteStepKind.TurnRight));
rightZigzag.Steps.Add(
 new RouteStep(RouteStepKind.AdvanceRelative, 1));
rightZigzag.Steps.Add(
 new RouteStep(RouteStepKind.TurnLeft));
rightZigzag.Steps.Add(
 new RouteStep(RouteStepKind.AdvanceRelative, 0.5f));
router.Patterns.Add(rightZigzag);

// this can be defined in shorter form using a pattern string
// var rightZigzag = new RoutePattern(
//     "ADR0.5 TRR ADR1 TRL ADR0.5");

Composite router

The CompositeRouter class lets you chain link routers (objects implementing ILinkRouter interface) so that a link passes through the sequence until it gets routed successfully. Diagram's default router is now set to a CompositeRouter instance containing a PatternRouter and GridRouter sequence. This applies the several standard pattern paths when possible, and otherwise routes links using the cost minimizing heuristics-based grid router.

SvgExporter improvements

  • Item's Opacity is set as SVG "opacity" attribute.
  • Item's FontWeight is set as SVG "font-weight" attribute.
  • Fixed text left padding in SvgExporter.
  • SvgExporter sets more precise font size.

Miscellaneous

  • Disabling AvoidOverlaps property of RoutingOptions lets you create routes with overlapping segments.
  • SvgNode supports transforms on bitmap images embedded in SVG.
  • Fixed index exception in SvgNode when path coordinates are delimited by new-line characters.

API changes

New in version 3.8.3

New grouping types

  • Attach to fractional position of main node and keep attached node's size by calling AttachToFractionalPosition method of Group or respective AttachTo overload.
  • Implement custom group positioning by calling AttachCustom and overriding UpdateGroup. The UpdateGroup override must set the position of attached nodes by calling their SetBounds method.
  • Attach a node to a point from link's geometry (not necessarily a control point) by calling AttachAlongLinkLength method of Group or respective AttachTo overload. The group preserves original distance from node to the point along link's length, regardless of the number and shape of link segments.

SvgNode improvements

  • The ContentAutoBounds property specifies whether to calculate content bounds from SVG elements' coordinates, or to honor the drawing's viewbox.
  • SvgNode now displays bitmaps embedded in SVG content.
  • SvgNode now supports dashed lines in SVG content (defined via stroke-dasharray attribute).

Miscellaneous

  • EnableParallelism and MaxDegreeOfParallelism layout properties now available in CoreCLR assemblies (.NET Core 3 and 5+ versions).
  • Intersects methods changed to public virtual to allow overriding them in custom item classes.
  • The ResizeType property of LaneGrid allows setting interactive row/column resize mode that preserves total grid size by subtracting resize amount from lane adjacent to the resized one.

New in version 3.8.2

Multiple labels per node

The 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 TextAlignment and TextVerticalAlignment 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:

C#  Copy Code

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

New in version 3.8.1

.NET 6 assemblies

The distribution now includes assemblies for .NET 6. Automatic VS toolbox integration is not available at this time; you must add diagramming.wpf assembly references to the project manually or through Nuget, and then add corresponding elements to Xaml markup for the various controls from the library.

Miscellaneous

New in version 3.8

Scrollable containers

Set the Scrollable property of ContainerNode to let users scroll the container's contents. The node then displays scrollbars at right and bottom edges that can be used to scroll interactively. The ScrollX and ScrollY properties let you determine current scroll position or change it programmatically. Note that in order to let container's content overflow and become scrollable, you must either disable AutoGrow, or allow users reduce container size by changing HandlesStyle and EnabledHandles properties from their default MoveOnly / Move values.

Container improvements

  • ContainerNode containment is no longer implemented via a Group object. Child nodes are now stored in a dedicated Children collection, and a node's container is returned by the Container property.
  • The ClipChildren property specifies whether to clip child items to container’s boundaries.
  • Enable the AutoDeleteChildren property to automatically delete child nodes when a container is deleted.
  • Drag-and-drop operations from NodeListView and ShapeListBox automatically add the newly created node to a container if one is found at the drop position.
  • Call the ResizeToFitChildren method to resize a container, making it big enough to contain its child nodes.
  • The FoldedSize property of ContainerNode specifies the container's size when it is folded.
  • The KeepInsideParent constraint of child nodes now also prevents them from overlapping the container's caption bar.

API changes

  • Container's child nodes are no longer accessible via SubordinateGroup; use the container's Children collection instead.
  • A node's container is no longer accessible via MasterGroup; use the Container property instead.
  • Child nodes are now also children of their Container in the WPF visual tree, instead of the Diagram, which could affect code that relies on VisualTreeHelper API.

New in version 3.7

SVG nodes

The SvgNode class represents nodes that display SVG drawings, in addition to the rendering provided by the base ShapeNode class. A node's SVG drawing is rendered after its associated bitmap Image. Set the Transparent property of base type to hide the node's Shape geometry and draw only SVG graphics. The SVG drawing that should be shown inside an SvgNode is specified through the node's Content property. SVG graphics are loaded and associated with the node through an SvgContent object, which should be initialized and then assigned to this property.

Import diagrams from SVG

The SvgImporter class allows importing Scalable Vector Graphics files (*.svg) into MindFusion.Diagramming. Each top-level SVG group element is imported as a separate SvgNode, whose Content is set to the group's child elements. If the SVG file was exported from Visio or OpenOffice Draw, SvgImporter will create DiagramLink objects for groups it recognizes as connectors in order to recreate the original diagram model, though in this case it will not preserve fully the original appearance of connectors in SVG.

Code 128 barcodes

BarcodeNode now supports barcodes in code 128 format.

New in version 3.6.3

Lasso zoom tool

The control now supports several ways to zoom using lasso tool:

Layout improvements

Miscellaneous

  • ImageAlign supports new FitLeft, FitTop, FitRight and FitBottom alignment styles, which resize Image to fit node's boundaries and align it to respective border.
  • The InitializeLasso event lets you customize appearance of selection lasso before it shows on screen.

API changes

The Behavior property setter no longer clears current selection. Call the SetBehavior method with true argument instead if you need selection cleared too.

New in version 3.6.2

.NET 5 assemblies

The distribution now includes assemblies for .NET 5. Automatic VS toolbox integration is not available at this time; you must add diagramming.wpf assembly references to the project manually or through Nuget, and then add corresponding elements to Xaml markup for the various controls from the library.

Fishbone diagrams

The FishboneDiagram controls creates Ishikawa diagrams (a.k.a. fishbone or cause-and-effect diagrams) from specified data source. Fishbone diagrams are used to display causes of manufacturing effect / defect / event, grouped in categories, and arranged as ribs around a backbone. The FishboneDiagram control creates a category branch (rib) for each item specified in the ItemsSource property. Category labels are obtained from the items' property specified by LabelPath. The causes in a category are obtained from the collection-property of items specified via CausesPath. If the collection contains strings, they are displayed directly as labels in respective branch. If causes are data objects, their labels are obtained through CauseLabelPath.

Miscellaneous

New in version 3.6.1

.NET Core assemblies

The distribution now includes assemblies for .NET Core 3.1. Automatic VS toolbox integration is not available at this time; you must add diagramming.wpf assembly references to the project manually or through Nuget, and then add corresponding elements to Xaml markup for the various controls from the library.

Miscellaneous

  • The MoveNodes behavior allows grabbing nodes to drag them without using adjustment handles.
  • Added protected visibility to CompleteModify overloaded method of DiagramItem, called for indirect modifications.
  • PanBehavior class used to implement Pan and PanAndModify behaviors is now public, allowing deriving custom behaviors from it.
  • ArrangeAnimated fixes.

API changes

NodeModifying and LinkModifying events are now also raised for items in multiple-selection.

New in version 3.6

Animated layout

ArrangeAnimated methods added to Diagram and ContainerNode classes animate the movement of items from their original locations to new locations assigned by the layout object. This can be used to create an explode effect by starting new layout from overlapping nodes on same position, or an insertion effect by adding a new node to an existing layout.

JSON serialization

Diagrams can now be serialized in JSON format. This can be used for interoperability with MindFusion JavaScript diagramming library, or for general storage in JSON files or databases. To serialize a Diagram to a JSON string, call its SaveToJson method. To deserialize a diagram back from its JSON representation, call the LoadFromJson method. Custom item classes can implement JSON serialization for their additional properties by overriding the SaveToJson and LoadFromJson methods of DiagramItem. Such classes must be registered for serialization by calling the RegisterItemClass method and providing a string identifier for the clientClass parameter.

Localization improvements

  • Right-to-left text support in PdfExporter.
  • Support for right-to-left text in styled text. This is still experimental and behind static RightToLeftStyledText flag.
  • Fix for PdfExporter creating incorrect PDF files on Chinese versions of Windows.

Miscellaneous

New in version 3.5.5

  • Fixed Clear method of diagram's Items, Links, Nodes collections.
  • Fixed formatting of link texts that contain pipe symbols.
  • Fixed offset of custom shapes outline in exported PDF and SVG files.
  • Fixed uneven multiple resize when AutoAlignNodes is enabled.

New in version 3.5.4

DXF Exporter

DxfExporter exports diagrams to AutoDesk Drawing Exchange Format (DXF) files. In order to use this component, add a reference to the MindFusion.Diagramming.Wpf.DxfExport.dll assembly to the project. To create a DXF file from a diagram, create a DxfExporter instance and call its Export method, specifying a Diagram object and a file path as arguments.

Miscellaneous

New in version 3.5.3

Layout improvements

  • The KeepLinkShapes property of LayeredLayout lets you preserve initial Shape value of links when LinkType is set to Cascading. The orthogonal path applied by latter property is approximated using respective link shape.
  • Set ConsiderNodeShapes property of LayeredLayout to align link end points to non-rectangular node borders.
  • Fix for wrong link positions when the diagram contains folded containers.
  • Fix for unnecessarily large distance between subsequent layers after a long node appears in a layer.
  • ArrangeAsync method of CompositeLayout now also applies MasterLayout asynchronously.

PathFinder improvements

  • Speed of FindAllCycles and EnumAllCycles methods improved.
  • FindAllCycles and EnumAllCycles no longer report mirrored versions of cycles in undirected mode.

Miscellaneous

  • Z order of ContainerNode's children is now local to the container. Adding child node to a container no longer changes ZIndex values.
  • The Compact method of Diagram class moves nodes as far possible to the top or left sides of diagram without changing their initial relative positions.
  • The ExtendSelection element of ModifierKeyAction lets users select items with lasso rectangle without deselecting old ones.
  • Set KeepInsideDiagram property of Selection to prevent users from dragging multiple selection outside of diagram boundaries.
  • Fix for incorrectly exported Procedure shape by ExcelExporter.
  • Fix for link auto-routing around rotated DiagramNodeAdapter objects.

New in version 3.5.2

Export Excel files

The ExcelExporter class from MindFusion.Diagramming.Wpf.ExcelExport.dll assembly exports diagrams to Excel Open XML Format (XLSX) files. Diagrams are exported as Excel AutoShapes drawings. The Export overload that takes a DiagramDocument parameter creates a sheet for each DiagramPage in the document. The Export(Diagram) overload creates a single Excel sheet.

Miscellaneous

New in version 3.5.1

Export improvements

Miscellaneous

  • New Add overload of ContainerNode enables resizing child nodes proportionally to their container.
  • Group rotation fix when setting RotationAngle to zero from code.
  • The Visibility property of LinkLabel lets you hide labels temporarily.

New in version 3.5

Non-blocking layout methods

All graph layout classes now contain an async ArrangeAsync method that runs layout calculations in a background task. This is only available in .NET 4.5 build of the diagram assemblies.

C#  Copy Code

async void OnLayoutLayered(object sender, RoutedEventArgs e)
{
    var layout = new LayeredLayout();
    await layout.ArrangeAsync(diagram);
    diagram.ZoomToFit();
}

VirtualizingDiagram improvements

  • VirtualizingDiagram can contain nodes of different types now. Nodes returned for data items by InstantiateNode callback are stored in separate pools according to their type, and data items reuse node instances from respective pool. VisualCacheSize now specifies the size of per-type node pools.
  • If a data item has Container property set, the control associates its node with Container item's node. It Container item has been realized as a ContainerNode, the source node is added to it as a child. If Container's realized node is of another type, the source node is attached as subordinate using AttachTo method. An alternative way to specify container items is via the ResolveContainer callback.

Overview improvements

  • The boolean FitAll has been replaced by ScaleMode enumeration property. It implements a third scaling mode where overview's scale stays fixed and ignores diagram's zoom level.
  • If AllowZoom is enabled, users can zoom the diagram by resizing the overview's viewport tracking rectangle.

Miscellaneous

New in version 3.4.3

Flip shapes

The shape of a ShapeNode can be flipped horizontally or vertically. Enable the AllowFlip property and the shape flips when an edge is dragged over its opposite edge. You can get or set current flip state using FlipX and FlipY properties.

DiagramLink improvements

  • AllowSplitLinks now works for Bezier links too. Users can insert a new Bezier segment by dragging any point (other than a control point) of a selected link. Adjacent segments can be merged back into a single one by dragging a tangent control point (square adjustment handle) onto a pass-through control point (round adjustment handle).
  • IntermediateShape shapes are now rendered at correct position for Spline links.
  • RerouteLinks.WhileModifying now works when multiple nodes are being dragged, either due to selection or grouping.
  • Fix for link visibility issues when folding nested containers.

Miscellaneous

New in version 3.4.2

Fluent API

Extension methods in MindFusion.Diagramming.Wpf.Fluent and MindFusion.Diagramming.Wpf.Layout.Fluent namespaces let you initialize objects using fluent programming style:
C#  Copy Code

using MindFusion.Diagramming.Wpf.Fluent;
using MindFusion.Diagramming.Wpf.Layout.Fluent;
//...

diagram.Factory
    .CreateShapeNode(20, 20, 60, 40)
        .Brush(Colors.LightGray)
        .Font("Arial", 12)
        .EnableStyledText(true)
        .Text("Task <i>1</i>")
        .ToolTip("This is the task")
        .TextRotationAngle(15);

new TreeLayout()
   .LevelDistance(20)
   .NodeDistance(20)
   .LinkStyle(TreeLayoutLinkType.Cascading3)
   .Arrange(diagram);

DiagramLink improvements

  • The component no longer keeps a separate segmentCount field, removing a common source of errors. The SegmentCount property now calculates its value from ControlPoints elements. The UpdateFromPoints(updateGroups, updateSegments) overload has been removed too.
  • SegmentCount setter no longer refuses changing number of segments if auto-routing is enabled or the link is a self-loop.
  • The new Spline element of LinkShape enumeration draws links as interpolating splines that pass through all of their control points:

Miscellaneous

New in version 3.4.1

ShapeListBox control

The ShapeListBox control displays a list of Shape icons along with their DisplayName. It lets users drag-and-drop a Shape to the diagram's canvas to create a new ShapeNode. Set the ItemsSource property to an array or collection of shapes that should be rendered inside the control. For example, setting the Shape.Shapes list as ItemsSource will show all pre-defined shapes. You can customize the shape appearance by setting ShapeBrush and ShapeSize properties.

Shape formula improvements

Miscellaneous

  • Enable inertia for pan interactions by setting the PanInertia property to true.
  • NodeRenderer added to custom node templates will now repaint automatically when any dependency property of the node changes.
  • Set FreeFormMode to enable free-form lasso selection that lets users draw irregular outline to select items inside.
  • HeadStrokeDashStyle property added to DiagramLink lets you set the dash style of arrowhead outlines independently from link segments' one.
  • Fixed orientation change gesture for cascading links when AllowSplitLinks is enabled.
  • PdfExporter now creates page hyperlinks if HyperLink is set to a value in "page://{number}" format, e.g. set "page://1" to open the second PDF page when the item is clicked.
  • Disable adding new headers to the lanes grid by setting AllowAddHeaders to false.
  • The Visio Stencils import API provides access to BeginArrow and EndArrow values.
  • The Visio Stencils import API provides access to Connection elements defined for a shape.
  • Fixed bug in ResizeToFitText method with long words in the text when preserving node's ratio.

New in version 3.4

Free-form nodes

A FreeFormNode collects all points from users' mouse or touch input and displays them as node's outline. To let users draw free-form nodes interactively, set Behavior to DrawFreeForms or LinkFreeForms. Use the Points property of FreeFormNode to get or set outline points programmatically. If the Closed property is set, the node is drawn as a closed shape and its interior filled, or otherwise the node is drawn as a poly-line. If the distance between first and last points drawn by user is shorter than AutoCloseDistance, the node's Closed property is automatically set to true. AutoCloseDistance default value is Double.MaxValue, so free-form nodes are always closed.

Additional drawing modes, convenient for touch input, convert FreeFormNode objects drawn by user to ShapeNode objects with most similar shape. To enable them, set Behavior to DrawFreeShapes or LinkFreeShapes. The shapes against which the user's input is matched are set via diagram's FreeFormTargets property. By default it contains Rectangle, Decision and Ellipse shapes.

Shape control points

Shape formulas can now be parameterized by associating control points with Shape objects. Each control point is passed to the shape script as a named variable. Apart from the name, you can specify the default, min and max coordinates for each parameter via the ShapeControlPoint constructor, and whether to treat its values as percents or fixed offset.

Miscellaneous

  • Undo/redo records for in-place edit operations are now created automatically. They are represented by instances of the EditTextCmd class.
  • LinkTextStyle.Center improved for vertical links.
  • Fixed a bug where link to a child node inside a nested container would not point to correct position if both nested and outer containers are folded.

API changes

Adjustment handles are no longer identified by integer values but by instances of AdjustmentHandle -derived classes. This changes the signatures of HitTestHandle methods and the InteractionState constructor. Standard handle classes included are NodeAdjustmentHandle for changing a node's position and size, LinkAdjustmentHandle for changing link control point positions, ShapeAdjustmentHandle for adjusting shape formula parameters, and FreeFormHandle for changing the position of a FreeFormNode outline point.

New in version 3.3.1

Resize table columns and rowsColumns and rows of a TableNode can now be resized interactively if its AllowResizeColumns or AllowResizeRows properties are enabled. In order to resize, move the mouse pointer to the border line on column's right side or row's bottom side until it shows resize cursor and start dragging. The control raises TableColumnResizing and TableRowResizing events to let you validate new size or prevent resizing some elements. The TableColumnResized and TableRowResized events are raised after the operation completes.

Barcode nodes

The BarcodeNode class displays EAN, UPC or QR barcodes as node's content. In-place edit operations let users enter new numeric codes for 1D codes or text strings for QR codes. The barcode format is specified via the Format property, the encoded number or text is set via Content, and color of 1D bars / 2D modules via BarColor.

ShapeDesigner improvements

  • The ShapeDesigner control supports undo. Call its Undo or Redo methods to respectively undo or redo a change done to the designed shape.
  • ZoomFactor property added to ShapeDesigner. It also supports interactive zoom in/out via mouse wheel.
  • The SelectedElement property exposes the graphic element currently selected in ShapeDesigner canvas. You can bind to its stroke and brush properties to create alternative user interface for editing element attributes.

Miscellaneous

  • KeepInsideDiagram property of NodeConstraints prevents a node from leaving diagram boundaries during user interaction (the older RestrictItemsToBounds property does not stop nodes from leaving diagram area but returns them to original position if dropped outside).
  • Dashed selection frames are now drawn in two colors and should be visible on both the default white background and custom darker backgrounds. You can change the second dash color by setting DashBackground property of HandlesVisualStyle.
  • Set the WhileModifying flag in RoutingOptions.TriggerRerouting to reroute links while users drag their end points.
  • Custom connection point classes can now override NearestAnchorPoint to implement custom anchor point selection logic; the method is now also called at the beginning of interactive link creation.

Fixed bugs

  • Fix for incorrect Visio formula parsing in VisioNodes for some regional settings.
  • Dots in item borders were not visible with default StrokeDashCap value when using dot and dash-dot stroke styles. Default value has been changed from Flat to Square to fix that.
  • Links to contained nodes were left visibly disconnected from them after deleting a folded ContainerNode.

New in version 3.3

Support for Visio stencils

The diagram can now display shapes from stencil files in Visio 2003 XML stencil format (.vsx). To load a stencil file, use an instance of the VisioStencil class. The shapes are displayed in the diagram through VisioNode objects. To associate a stencil shape with the node, create an instance of the VisioContent class and assign it to the node's Content property. Note that standard stencils installed with Visio are copyrighted by Microsoft, and you should not use them in your application. This feature is intended to let you use public domain stencils, or commercial clipart you have purchased a license for.

License keys

There is no separate trial build of the control assemblies anymore. Instead, set the LicenseKey property of Diagram or DiagramDocument to disable the component's evaluation mode and stop displaying trial messages. If your application contains more than one Diagram instance or other controls by MindFusion, you could call MindFusion.Licensing.LicenseManager.AddLicense(key) from application start-up code to specify the key once instead of setting it per each control. License key strings are now listed on the Keys & Downloads page at MindFusion's customer portal.

AnchorPatern improvements

  • The XUnit and YUnit properties allow specifying the coordinates of an AnchorPoint as a fixed offset from the node's top-left corner rather than in percentage, so that the point position does not change when the node is resized.
  • The AnchorPattern property of Shape class lets you associate anchor points with shape definitions. If a ShapeNode instance does not contain its own AnchorPattern, it will derive the one defined by the node's Shape.
  • The RowAnchorPattern property lets you specify default AnchorPattern for all table rows.

Miscellaneous

New in version 3.2

Support for Xaml templates

  • Template property has been added to the base DiagramNode class and now all node types can be templated. A NodeRenderer element can be added to templates to invoke nodes' standard low-level drawing code before rendering custom template elements.
  • TableNode cells can be templated by setting the Template property of the Cell class for individual cells, or by defining a template for all cells using a default style with {x:Type diag:TableNode+Cell} as a target type.

Improved arrowhead rendering

  • Arrowheads are rendered as a single path when possible and several arrowhead Shape definitions have been changed to implement mitered joints when HeadPen is set to a thick pen.
  • The point where end segments connect to arrowheads can be specified via the LinkSegmentInset property of Shape. Shape definitions from the ArrowHeads class set it to suitable default value. This allows using transparent or semi-transparent brushes without seeing the link line drawn behind arrowheads.

Shape designer control

The ShapeDesigner component implements a vector-drawing canvas where Shape definitions can be created interactively. Call the ImportShape method to open a shape for editing. Call the ExportShape method to create a Shape with specified Id from current content of the designer canvas. ShapeDesigner shows a palette with two kinds of elements: Primitives which when dropped on the canvas add a single curve or line segment, and Templates which when dropped on canvas add a closed path of several graphic primitives.

Export improvements

Dependency properties

The following properties have been converted to dependency properties:

Miscellaneous

API changes

  • For consistence with MindFusion libraries for other platforms, BackBrush in default diagram style has been changed to white brush.
  • Type of LinkLabel.Margin property changed from double to Thickness.
  • ZoomControl can be now used with other MindFusion components and has been moved to MindFusion.Common.Wpf assembly in MindFusion.UI.Wpf namespace.

New in version 3.1

Tree map layout

Tree maps represent hierarchies by nesting child nodes within their parents, where the areas of leaf nodes are proportional to their Weight values. Unlike other layout algorithms, TreeMapLayout expects hierarchies to be defined via grouping or containment (see AttachTo method and ContainerNode class), and will ignore any links in the diagram. The diagram area covered by the topmost nodes in a hierarchy is specified via the LayoutArea property. By default, the layout tries to keep the ratio of node sides as close as possible to one. However this could make it hard to distinguish separate levels of the hierarchy. To alleviate that, set Squarify to false, and child nodes will be arranged either as a row or a column inside their parent node, alternating directions for each level. The drawback is that when Weight ratios differ greatly or nodes contain many children, some nodes could end up with very narrow rectangles.

Decision flowchart layout

DecisionLayout arranges simple flowcharts consisting of decision boxes with up to three outgoing links per node and activity boxes with a single outgoing link per node. The nodes are arranged in columns and rows, whose distance depends on the HorizontalPadding and VerticalPadding property values. When links share the same row or column, they are placed at a distance specified via LinkPadding. The layout arranges nodes recursively starting from StartNode. If StartNode is not specified, the algorithm selects the root of the deepest branch of the graph's spanning tree as start node.

Miscellaneous

Layout algorithms now automatically resize diagram's Bounds if it's not large enough to fit the arranged content. To revert to old behavior and keep fixed Bounds size, set GrowToFit to false.

New in version 3.0.5

Export Visio 2013 files

The Visio2013Exporter class can export the content of Diagram and DiagramDocument objects to Visio 2013 VSDX files. In order to use it, add a reference to the MindFusion.Diagramming.Wpf.VisioExport.dll assembly. Similarly to the VDX format exporter, Visio2013Exporter relies on a template file, called Visio2013.vxt, containing some boilerplate Visio XML code. The template must be either located in same folder as the application assemblies, or its path must be specified via the TemplatePath property. At this time the exporter supports shapes from Visio basic stencil.

Visio2013Importer improvements

  • The importer now supports Visio group shapes. Child shapes in groups are no longer lost when importing, and their corresponding diagram nodes are attached to the corresponding group node.
  • Visio NURBS curves are now imported as Bezier-style links.
  • Fix for importing connectors with applied rotation transform.
  • Shapes with a hidden attribute in master definition are now imported as invisible items.
  • The Item argument of ImportItem event handlers is now pre-set to a DiagramItem instance created for the imported Visio shape, letting you avoid parsing some standard data such as Bounds or Text. You can either modify this item's properties, or replace it with a new instance of a different type.
  • Fixed a crash when a shape master does not have a name attribute (this happens with custom stencils).
  • Fixed a crash when theme1.xml is missing from the imported vsdx archive (this happens with files converted from old Visio versions to 2013 format).
  • Fixed a parse exception for some non-English locales.
  • Fixed a bug where one-segment connectors were imported at wrong positions.

Miscellaneous

API changes

New in version 3.0.4

Import Visio 2013 files

The Visio2013Importer class can import .vsdx files, created by version 2013 of Microsoft Visio. In order to use it, you must add a reference to the MindFusion.Diagramming.Wpf.VisioImport.dll assembly. Various overloads of the Import method can be used to import the Visio drawing into a DiagramDocument whose pages correspond to the Visio pages, or into a single Diagram whose content is merged from all imported pages. When merging multiple pages, their positions in the diagram depend on the PagesPerRow value. Visio2013Importer supports Visio's basic flowchart and data flow stencils. For each node shape from the .vsdx file, the importer creates a ShapeNode object whose Shape, Text, Brush and Stroke properties are set to values corresponding to the imported Visio shape. For each connector shape, the importer creates a DiagramLink object whose Origin and Destination are set to the corresponding imported nodes, and whose ControlPoints reflect the geometry of the connector.

Zoom control

The MindFusion.UI.WpfZoomControl class lets user change interactively the current zoom level and scroll position of a Diagram or DiagramView. To set it up, add a MindFusion.UI.WpfZoomControl to the window, place it anywhere over the target diagram, and set the control's Target property to that diagram or view. Set the ZoomStep and ScrollStep properties to specify the amount added to view's zoom level or scroll position by MindFusion.UI.WpfZoomControl's buttons. You can customize the control's appearance by setting properties such as Fill, Stroke, CornerRadius and TickPosition.

Miscellaneous

New in version 3.0.3

Import OpenOffice Draw files

The DrawImporter class can import .odg files, created by the OpenOffice Draw vector graphics editor. In order to use it, you must add a reference to the MindFusion.Diagramming.Wpf.DrawImport.dll assembly. Various overloads of the Import method can be used to import the OpenOffice drawing into a DiagramDocument whose pages correspond to the Draw pages, or into a single Diagram whose content is merged from all imported pages. DrawImporter supports shapes from the General and Flowchart shape palettes in Draw. For each node shape from the .odg file, the importer creates a ShapeNode object whose Shape, Text, Brush and Stroke properties are set to values corresponding to the imported OpenOffice shape. For each connector shape, the importer creates a DiagramLink object whose Origin and Destination are set to the corresponding imported nodes, and whose ControlPoints reflect the geometry of the connector.

Display graphs in 3D

The DiagramView3D control lets you display the elements of a diagram in 3D space. Assign the Diagram that should be displayed in this view to the Diagram property. DiagramView3D adds a 3D model to the scene for each node or link of the specified diagram. The positions of nodes in 3D coordinate space are specified via the Position3D attached property. Links are rendered as straight lines connecting the 3D node models. By default, nodes always face the camera, unless NodeRotationType is set to None.

Miscellaneous

  • Improved appearance of hatch patterns used to draw frames for several HandlesStyle types.
  • Added support for loading HatchBrush objects from files saved by Windows Forms and ASP.NET versions of the control. Such brushes are implemented using the WPF ImageBrush class, and you can create brushes corresponding to GDI+ HatchStyle patterns using the CreateInstance method of the HatchBrush class.

New in version 3.0.2

Import Visio 2003 XML drawings

VisioImporter allows importing Visio 2003 XML Drawing files (*.vdx) into WpfDiagram. The standard Visio flowchart shapes, as well as most of the UML and Database entity shapes are imported to their closest representation in the MindFusion.Diagramming object model. The Visio connectors are imported as DiagramLink objects, preserving the relationship between the connected nodes. In addition, most of the attributes of Visio objects such as text, text formatting, fill and line colors and styles are preserved. The component raises an event for each imported node to let you set the node shape if it is not recognized by MindFusion.Diagramming or if you need to set a different shape.

The Import method imports all Visio pages into a DiagramDocument, creating a DiagramPage for each page from the VDX. To determine how many pages there are in a Visio document and import only a single page, call the GetPageCount and ImportPage methods. All pages of a Visio drawing can be imported into a single Diagram by calling the ImportAllPages method, which lays out the pages as set in PagesPerRow.

Miscellaneous

  • AttachTo overloads that attach nodes to link segments or control points now allow specifying negative index values. Negative values are interpreted as relative to the last point or segment, regardless of the current number of link segments. For example, -2 denotes the second-to-last point or segment.
  • Improved handling of clip paths in PdfExporter.
  • The swimlane grid can be exported to Visio by setting the ExportLanes property of VisioExporter.
  • The Copy method lets you copy text attributes between objects implementing the ITextAttributes interface, such as diagram items, table cells and tree items.
  • Improved placement of link labels along shorter link segments.
  • The ArrangeLinkLabels method rearranges link labels whose AutoArrange flag is set.

New in version 3.0.1

Preserve order in tree layout

The Balance property of TreeLayout can be set to Preserve to keep the original geometric order of child nodes when arranging them under their parent. This can be used to arrange tree branches in a specific order by first positioning them in increasing horizontal or vertical positions. Another possibility is to apply TreeLayout from NodeModified handler to let users rearrange the tree branches by dragging and dropping a node.

Selection improvements

  • Set Behavior to SelectOnly to let users select existing items, but not modify them or draw new ones.
  • The SetsDirtyFlag property of the Selection class specifies whether the Dirty flag should be set when selection changes.
  • SelectionStartMoving event raised when the user begins moving multiple selected items.
  • The ToggleSelection modifier key can be used to select or deselect items by clicking, but disables selection via lasso rectangle.

Miscellaneous

  • The AllowAddChildren and AllowRemoveChildren properties of ContainerNode specify whether users are allowed to add or remove child nodes to / from the container.
  • The GetNearestBorderPoint method of DiagramNode can be used to find a point from the node's border closest to a specified point.
  • The ScrollZoneSize property of Diagram can be used to specify the size of the area near the control edges that starts auto-scrolling.
  • The last row in a TableNode will now be rendered clipped if it fits only partially inside the node, whereas in previous versions the row would not be rendered at all.
  • The HandlesStyle of a link can now be set to Invisible to stop rendering its selection handles, but still allow dragging control points.
  • The Tag property of DiagramDocument (inherited from FrameworkElement) is now automatically saved in XML files if it's a simple value, and SerializeTag is raised to let you save complex objects.

Fixed bugs

  • Ruler alignment guides did not set the Dirty flag.
  • Images exported by CreateImage excluded items at negative coordinates.
  • ZTop and ZBottom methods did not work correctly with layers.

New in version 3.0

Node effects

Two visual effects, represented by GlassEffect and AeroEffect classes, can be applied to nodes. To apply an effect, create an instance of the respective class, set up its properties, then add the instance to the Effects collection of a node (or to Diagram.NodeEffects collection to apply it to all nodes). Effects can be added, removed or modified at any time and this will immediately reflect on the diagram. Effects of different types can be applied simultaneously. It is also possible to apply more than one effect of the same type.

Improved styling support

The Brush, Stroke* and Font* dependency properties no longer contain initial local values and will inherit style values without having to clear the local values first. The diagram now exposes a style property for each built-in node type, which allows creating global styles for nodes directly in the diagram's markup code in the Xaml page. The properties are called ShapeNodeStyle, TableNodeStyle, etc. and are of the WPF's standard Style type.

Themes and Theme Editor

A theme in WpfDiagram is a set of styles, each associated with specific item type. When the theme is applied to a diagram, the styles registered in the theme affect all objects of their associated type. Themes are represented by the Theme class and can be assigned to Diagram objects through their Theme property. Styles are associated with item types within the theme through the RegisterStyle method. The package now includes a Theme Editor tool that provides simple visual environment for theme creation and modification. There are also several predefined themes available in the Themes subfolder of the installation root folder. For more information about this new feature, check Styles and Themes.

Diagram documents and tabbed views

The DiagramDocument class represents a collection of diagram pages or sheets, represented by DiagramPage objects. DiagramPage is derived from Diagram and only adds a Title property, so any current code that processes Diagram objects will work with DiagramPage objects too. New pages can be added to the document and existing pages can be removed and reordered via the Pages collection. The diagram document provides higher level of events for the pages contained inside it. The document supports the notion of an active page.

The new TabbedDiagramView can be used to display DiagramDocument objects. The view displays tabs for the individual pages in the document. The active page can be changed interactively by activating its associated tab. New pages can be added and removed to/from the document through buttons in the tab tray and the pages can be rearranged by dragging their associated tabs with the mouse.

One-way graph Layout

The OneWayLayout class ensures that links enter into nodes from the same general direction and exit them from the opposite side. If the graph contains cycles, some links bend around the nodes to keep the enter/exit direction consistent. The algorithm aims to minimize the number of such links.

Multiple labels per link

The LinkLabel class allows multiple captions to be displayed for a single DiagramLink object. Link labels provide a set of properties allowing full customization of their display and positioning. Labels can also be arranged automatically to avoid overlapping nodes and other labels by setting LinkLabel.AutoArrange to true.

Layers

Items can now be assigned to layers, and layers can be hidden, locked or moved up/down in the Z order as a group. Set the LayerIndex property of items to associate them with layers in the Diagram.Layers collection. The Layer objects provide Visible, Locked and ZIndex properties, which will affect all items in the respective layer. Layers also expose a Title property shown in the LayerListView control. Newly drawn items are added to the layer specified via Diagram.ActiveLayer. For additional information about layers, refer to Layers.

Layer list control

The LayerListView control provides user interface for working with Layer objects. The control displays a list of all layers in a specified Diagram with a title and an overview area, and also allows editing of layer's Title, Visible and Locked properties and choosing the Diagram's currently active layer. New layers can be added to the Diagram by clicking the '+' button. The selected layer can be deleted by clicking the '-' button.

Parallel layouts

The .NET 4 version of WpfDiagram takes advantage of the Task Parallel Library (TPL) to enable parallelism on the different layout algorithms. Set the EnableParallelism property on the Layout class to true to enable arranging different subgraphs on different threads to possibly improve performance on multiprocessor systems. In addition, the maximum degree of concurrency can be manipulated through the MaxDegreeOfParallelism property. Note that only independent subgraphs are processed in parallel, so the SplitGraph property of layout classes that provide it must also be set.

Magnifier

The new magnifier tool allows users to interactively zoom in (or out) portions of the diagram by holding down a modifier key or pressing a mouse button. The magnifier's zoom factor and appearance can be customized. Additional information can be found in the corresponding section of Scrolling and Zooming.

Miscellaneous

  • the value of DiagramItem.ZIndex property is no longer required to be unique and smaller than the number of items;
  • the Shape property in ContainerNode and TreeViewNode can be set to Rectangle or RoundedRectangle;
  • diagram item collection types now implement the generic IList<> interface;
  • PdfExporter now creates PDF Bezier objects for Bezier curves in the diagram instead of approximating them with lines;
  • the DrawBackground event is raised to let you render custom graphics in the diagram background;
  • VisioExporter.DynamicsOff can be used to disable dynamic link routing in Visio 2010 in order to preserve the position of control points from the exported diagram;

API changes

  • LinkStyle enum renamed to LinkShape;
  • DiagramLink.Style property renamed to Shape;
  • TableStyle enum renamed to SimpleShape;
  • TableNode.Style property renamed to Shape;
  • ZLevelUp, ZLevelDown, ZTop and ZBottom methods now require a boolean argument specifying whether items are allowed to change layers;
  • ZIndex no longer corresponds to the position of items within Diagram.Items collection. Items however still contains the items sorted by Z order, as defined by item's ZIndex and LayerIndex;
  • Event handler delegates have been removed; events are now defined as generic EventHandler specialized via EventArgs type. For example the type of NodeCreated is now EventHandler<NodeEventArgs>;

New in version 2.8.2

Rotation improvements

Miscellaneous

  • The SaveToXml method now saves the definition of a custom Shape if a node's Shape has not any Id specified.
  • If NegatedY is set, the vertical Ruler scale displays negated Y coordinates.
  • The Ruler control scales now start from the origin of the diagram's Bounds instead of (0,0).
  • Fixed a bug where GroupAnchorStyles attachments did not preserve the correct distance for some values.
  • The TextBox control used for in-place editing now wraps text to multiple lines by default.

New in version 2.8

Virtualization

VirtualizingDiagram can display very large diagrams where there are actual DiagramNode and DiagramLink instances created only for the elements that should be currently shown on screen. This helps keeping the WPF visual tree small and could lead to huge performance improvements if there are thousands of elements in the diagram.

The data items that should be displayed as nodes must be assigned to the NodesSource property, and the data items that should be displayed as links must be assigned to the LinksSource property. The BindingMode property specifies whether the data source should be updated when the user draws new diagram items interactively.

Miscellaneous

  • The Id property added to DiagramItem allows assigning custom identifiers to items. It can also be used to just store additional custom data similarly to Tag.
  • Call FindLinkById and FindNodeById to find items by their Id.
  • HookHeaders enables lane headers to be anchored to the left and top sides of the control's visible area.
  • Improved path-finding for long links in QuickRouter.
  • StartPoint and EndPoint provide a shortcut to setting the first and last control points of a DiagramLink.

New in version 2.7

Automatic node alignment

If AutoAlignNodes is enabled, the node currently being drawn or resized is aligned to another node so that a pair of their vertical or horizontal sides become collinear. To specify the maximal distance at which nodes are aligned, set the AutoAlignDistance property. The pair of aligned nodes is indicated visually by drawing an alignment guide using the pen assigned to AlignmentGuidePen.

Fractal tree layout

FractalLayout is a tree layout algorithm that places child nodes symmetrically around their parent node. Nodes at the lowest level are arranged directly in a circle around their parent. At the upper level, the already arranged nodes form branches that are arranged in a circle around the new parent node. The algorithm is recursively repeated till the highest level is reached. If nodes in the tree have uniform number of children, the end result has fractal-like appearance (subsets of the graph look like scaled-down copies of the whole graph).

You can choose which node should be displayed at the center of the topmost circle by setting the Root property. If it is not specified, the algorithm automatically selects a root that leads to more balanced distribution of nodes.

Miscellaneous

New in version 2.6

CompositeLayout algorithm

CompositeLayout partitions the diagram into several subgraphs and applies the algorithm specified via the SubgraphLayout property on each part. If the part is a tree, it is arranged using the algorithm specified via the SubtreeLayout property, which is set to a radial TreeLayout instance by default. Finally the algorithm specified via MasterLayout is applied on the graph that represents the overall partition. By running the polynomial-complexity layout algorithms on small subgraphs, CompositeLayout is able to process a large graph much faster than if a layout algorithm is applied on the whole graph.

CompositeLayout can run on custom partitions specified as lists of nodes, or automatically partition the diagram via two automatic methods based on graph connectivity and graph path lengths. Set the PartitionMethod and CustomPartition properties to specify how the diagram should be partitioned.

Other layout improvements

Miscellaneous

  • Now it is possible to resize multiple nodes simultaneously. To enable this, set AllowMultipleResize to true.

New in version 2.5.2

Dynamic node shapes

Shape instances can be defined using custom code that takes into consideration the current width and height of nodes. This allows creating shapes whose primitive elements change non-uniformly, e.g. by growing only in width or height when a node is resized. There are two ways to create such shapes. The first one is to use the Shape constructor that takes a CreatePathDelegate parameter, which can be implemented using a .NET function. Another Shape constructor takes a string argument that represents a Visio-like shape formula evaluated in run-time. The latter method enables serializing the shape code in external files, which can be reused by different applications and by MindFusion components for other platforms.

SpringLayout improvements

  • Better handling of large nodes and nodes with non-uniform size.
  • The SpringLayout energy model has been changed to one that leads to better symmetry in the arranged graphs. The old model can still be used by setting LayoutMethod to Classic. This is recommended when using rounded links.
  • The Randomize property allows starting the layout process from random node positions.

Miscellaneous

  • Call SetZoomFactor to zoom the diagram with the specified zoom center point.
  • The DrawAdjustmentHandles method can be used when custom-drawing to render adjustment handles with their standard look and feel.
  • Set the StableSort property to get consistent results between different runs of LayeredLayout.

New in version 2.5.1

Export diagrams to Visio

VisioExporter exports diagrams to Visio 2003 XML Drawing files (*.vdx). ShapeNode objects are mapped to their closest Visio counterparts and TableNode objects are exported as groups of Visio shapes. DiagramLink instances are exported as Visio connectors of a similar style. In addition, most of the attributes of diagram items such as text, text formatting, fill and line colors and styles are preserved. The exporter object requires the VisioExport.vxt file to be present in the application's directory. This file contains an XML template used by the component to generate Visio documents.

Link auto-snapping

Now links can automatically connect to the nearest diagram node without the mouse pointer reaching the node. This is enabled by setting the AutoSnapLinks property. The maximum distance at which auto-snap works can be specified through AutoSnapDistance. The SnapToNodeBorder property, which implemented similar functionality when the mouse is directly over a node, has been removed.

Miscellaneous

  • UBendMaxLen property added to QuickRouter.
  • Handle CopyHostedControl to clone hosted custom controls that cannot be processed automatically when copying nodes to the clipboard.
  • InchDivisions specifies how many minor divisions to display for each inch in the ruler.
  • The CopyFrom method of TextPresenter copies all text attributes from the specified object.

New in version 2.5

Swimlane layout algorithm

SwimlaneLayout can be used to arrange process diagrams in which nodes representing activities are placed in swimlanes representing resources. The index of the resource allocated to an activity should be assigned to the corresponding node's LayoutTraits[SwimlaneLayoutTraits.Lane].

By default, the algorithm works with the diagram's LaneGrid, but its SwimlaneGrid property can be set to any class that implements ISwimlaneGrid. This allows applying the layout to a custom-drawn grid rendered through a custom control template, or one composed of locked background nodes.

CascadeLayout algorithm

CascadeLayout places nodes on a virtual grid and arranges links orthogonally, such that if the source graph is planar all links are guaranteed to have no more than two bends and will not intersect. By default the layout method arranges nodes in rows and link segments in columns; this can be changed by setting the Orientation property.

TriangularLayout algorithm

TriangularLayout places nodes on a virtual grid, such that if the source graph is planar, all links are guaranteed to have a single segment and not intersect. If the graph is not planar, its intersecting links can be optionally segmented and bended in order to improve readability. The layout method places the nodes from the external face on a triangle and recursively adds the rest of the nodes as vertices of internal triangles. As a result, it is very effective for near maximal-planar (a.k.a. triangular) graphs.

HierarchicalLayout algorithm

HierarchicalLayout places nodes on user-defined levels, such that if the source graph is level-planar, all links are guaranteed to have a single segment and not intersect. The layout method requires that for each node LayoutTraits contains a HierarchicalLayoutTraits.Level entry specifying the level, and no two connected nodes must be on the same level.

Miscellaneous

New in version 2.4

Templated Nodes

The TemplatedNode class represents nodes whose appearance is set through Xaml data templates. This class is useful mostly as a base type of custom nodes, as shown in tutorials 3 and 4. However it is not abstract and can be used directly if the text -related properties defined in DiagramItem are sufficient for your purposes. The appearance of such nodes can be set through their Template property or the NodeTemplate property of the Diagram class.

WmfExporter component

The WmfExporter class creates a Windows Metafile (WMF) drawing from the content of a Diagram. The exporter enumerates all graphics primitives contained in the WPF visual tree and creates corresponding WMF records. This enables custom graphics and hosted controls to be rendered in WMF too. To use WmfExporter, add a reference to the MindFusion.Diagramming.Wpf.WmfExport.dll assembly to your project.

New in version 2.3.3

Export to SVG

The SvgExporter class creates a Scalable Vector Graphics (SVG) drawing from the content of a Diagram. The exporter enumerates all graphics primitives contained in the WPF visual tree and creates corresponding SVG elements. This enables custom graphics and hosted controls to be rendered in SVG too.

Miscellaneous

New in version 2.3.2

Styling

This version enables styling of diagram items through the WPF styling system. Now DiagramItem provides a Style property, which can be set to an instance of the System.Windows.Style class. The style can contain setters for the Brush, Stroke*, Text* and Font* dependency properties that were introduced in the last release. Using the style's TargetType attribute it is also possible to define a global style in the window or application resource dictionaries for each type of node.

Miscellaneous

  • ContainerNode now provides an UpdateBounds overload that also includes links in the new node boundaries.
  • A new ZoomToRect overload can center the specified rectangle in the current viewport.
  • The MouseInputMode property of DiagramNodeAdapter specifies which control should process mouse input.
  • Fixed support for browser applications in the Internet zone.

API changes

  • The LinkStyle enumeration and the Style property of links have been renamed respectively to LinkShape and Shape.
  • The TableStyle enumeration and the Style property of tables have been renamed respectively to TableShape and Shape.

New in version 2.3.1

New font properties

The Font property of diagram nodes, table cells and treeview items is deprecated. The DiagramItem class now exposes FontFamily, FontSize, FontStretch, FontStyle, FontWeight and TextDecorations dependency properties. This enables better support for the WPF animation and styling features. The Cell and TreeViewItem classes now derive from a common TextPresenter class that provides the same font properties as DiagramItem.

New text alignment properties

The TextFormat and CaptionFormat properties are now deprecated. They have been replaced by the TextAlignment, TextVerticalAlignment, TextWrapping and TextTrimming properties defined in DiagramItem. In addition, there is a new TextPadding property that specifies the padding of text within the text's bounding rectangle. The same properties are exposed by TextPresenter - the new base class of the Cell and TreeViewItem classes.

New pen properties

The Pen property of DiagramItem is deprecated. It has been replaced by Stroke, StrokeThickness, StrokeDashStyle, StrokeDashCap, StrokeStartLineCap, StrokeEndLineCap, StrokeLineJoin and StrokeMiterLimit. This enables better support for the WPF animation and styling features.

Miscellaneous

New in version 2.3

Support for custom arrowheads

The type of the HeadShape, BaseShape and IntermediateShape properties of DiagramLink has been changed from enum ArrowHead to class Shape, which is also used to define ShapeNode shapes. The ArrowHeads class now exposes Shape definitions that correspond to the ArrowHead enumeration members from previous versions. It is also possible to assign any Shapes member or a custom shape as an arrowhead. When used for arrowheads, position (50, 0) in the shape definition corresponds to the arrowhead's tip point.

Adjustment handles styling

The ActiveItemHandlesColor, SelectedItemHandlesColor and DisabledHandlesColor properties have been replaced by ActiveItemHandlesStyle, SelectedItemHandlesStyle and DisabledHandlesStyle. The HandlesVisualStyle objects returned by them provide sub-properties for greater control over the appearance of selection handles. The adjustment handles can now be painted not only in solid color but with arbitrary brushes, such as LinearGradientBrush and ImageBrush objects.

Miscellaneous

New in version 2.2.1

Relationship queries

The Query method of DiagramItem can be used to find items that can be reached from the current one by following a path described in the query expression specified as argument. The expression includes selectors separated by a / character, where each selector returns the items from the result set of the previous step. The expressions can also include boolean predicates that filter the results using boolean and arithmetic expressions.

Miscellaneous

New in version 2.2

TreeView nodes

The TreeViewNode class represents nodes that can display hierarchical data. The root items displayed in the node can be accessed through the RootItems property. New items can be added to and removed from the returned collection. The root items can have child items on their own and so on. For more information, refer to the TreeViewItem class.

BPMN shapes

This version adds predefined Shape definitions that implement the Object Management Group / Business Process Management notation. They are available as members of the Shapes class and have names that start with a Bpmn prefix. They can also be accessed by ID using the FromId method of Shape.

Flowchart graph layout

FlowchartLayout recognizes program code-like patterns in the graph, such as loops, sequences and if/switch branchings, and arranges them recursively. FlowchartLayout could be used to arrange other types of graphs as well, though with some restrictions. For example it treats all back links as loops in the code, and expects that they are nested - loop links starting closer to the stop node should end closer to the start node. Another similar restriction is that there shouldn't be any cross-links that connect different branches of a decision sub-graph.

Topological graph layout

If the underlying graph if acyclic, TopologicalLayout arranges the nodes linearly in such a way that each node comes before all destination nodes of its outgoing links. The links are drawn as curves above the chain of nodes, with their height proportional to the distance between the nodes. If the graph is not acyclic, the layout algorithm finds an ordering with a minimal number of back links, and draws the back links below the chain of nodes.

Link routing enhancements

A much faster link routing algorithm has been implemented. It can arrange a thousand links for just a few seconds, while older versions would require several minutes. Now it is also possible to create custom routing classes to be used when a link must be routed by implementing the ILinkRouter interface. An instance of such class can be set through the LinkRouter property of the DiagramWpfDiagram provides two classes that implement ILinkRouter - GridRouter and QuickRouter. By default LinkRouter is set to a QuickRouter instance.

Miscellaneous

  • The Behavior property can be set to Pan to allow panning without holding down ALT.
  • The ClipImage property of ShapeNode specifies whether the Image should be clipped by the shape geometry.
  • TableNode rows can be highlighted by setting their HighlightedRow property.
  • A new UpdateFromPoints overloaded method added to DiagramLink.
  • The LinkHitDistance property lets you specify the furthest distance from links that a click would be considered a hit.
  • The Ruler control raises the NodesAligned event when the user aligns nodes using the alignment guide.
  • The ReassignAnchorPoints method added to DiagramNode distributes all links connected to a node evenly among the available anchor points.
  • A new CreateImage overload allows exporting scaled images.

API changes

  • The type of the Image property of nodes and table cells has been changed from BitmapSource to ImageSource. This allows using Xaml drawing as images.
  • The GridColor property has been replaced by GridPen.
  • Now the ItemAdded event is raised also when items are added programmatically.

New in version 2.1.1

DiagramView control

The DiagramView class lets you display several views of the same diagram, each having distinct zoom level and scroll position. You can assign the shared Diagram object to the Diagram property of the views, either programmatically, for example, from a Window_Loaded event handler, or by using databinding syntax in Xaml.

TreeLayout improvements

  • The TreeLayout algorithm can produce a grid drawing of a full binary tree, aligning child nodes either horizontally or vertically to their parents in a way that the layout covers minimal area. To apply this layout, set the Type property to HorizontalVertical and call Arrange.
  • The EnableAssistants property of TreeLayout allows creating organizational charts as in MS Office.

Size synchronization with hosted UIElements

The SizeSyncMode property of DiagramNodeAdapter specifies how the size of the diagram node and the UIElement it hosts should be synchronized:

  • Arrange: Resizing the node calls Arrange on the hosted element.
  • SetSize: Resizing the node sets the hosted element's Width and Height properties.
  • Measure: The node is resized automatically to match the element's DesiredSize.

API changes

New in version 2.1

OrthogonalLayout

The OrthogonalLayout class implements an orthogonal graph layout algorithm. Each link is drawn as a chain of alternating horizontal and vertical segments. Nodes are placed in a way that facilitates few links bends and crossings. This algorithm was designed for planar graphs where the nodes have at most four incident links, and produces best results with such graphs as input. It can arrange any arbitrary graph as well, by adding some dummy nodes and links to planarize the graph and reduce its vertex degree, and removing them after the layout.

CircularLayout

CircularLayout distributes nodes evenly on the circumference of a circle at positions that result in as few link crossing as possible. Set its Radius property to specify the size of the layout circle. Set SiftingRounds to set the number of fine-tuning crossing-reduction iterations.

Lanes

The lane grid lets you emphasize the relationship between a group of diagram items by displaying them in a distinct lane or cell within the grid. To display the lane grid, set the EnableLanes property of the Diagram class to true. In order to customize the grid, set the various attributes exposed by the LaneGrid property, which lets you specify the number of rows and columns, add headers, customize the cell appearance, etc. The new Lanes sample project uses the lane grid to let users draw Gantt charts.

Miscellaneous

API changes

  • The OrthogonalLayout class from previous WpfDiagram versions has been renamed to OrthogonalRouter.
  • The PasteFromClipboard offset argument type changed from Point to Vector.
  • .NET 3.5 SP1 replaces the BitmapEffect class and types derived from it with the Effect class and respective derived classes that implement shader effects. With this, the DefaultBitmapEffect property of the Diagram class has been renamed to DefaultEffect, and its type has been changed to Effect. To assign shadow effects to individual diagram items, assign a DropShadowEffect instance to the items' Effect property.
  • The Ruler class has been moved from the MindFusion.Diagramming.Wpf.Ruler namespace to MindFusion.Diagramming.Wpf namespace.

Fixed bugs

  • Fixed a bug that led to disappearing diagram image in the Overview control.
  • PdfExporter did not use correct scale for the WPF points resolution of 96 DPI.

New in version 2

Containers

The ContainerNode class implements diagram nodes that can function as containers for other nodes. Containers can be folded to hide their content, and unfolded to show it again. Containers can be nested one within another, without limitation on the depth of nesting.

Ruler control

The Ruler control provides horizontal and vertical scales that helps users measure and align diagram items. In order to use the Ruler, it must be set as a parent of the Diagram object, that is the XAML element should contain the element. The control also implements a scrollable area and can be used instead of ScrollViewer.

NodeListView control

NodeListView is a toolbox alike control. It displays a list of node templates, and lets user create new nodes based on these templates by drag-and-drop. NodeListView can contain instances of any DiagramNode or UIElement derived classes.

Export to PDF

The PdfExporter class lets you exports diagrams to Adobe Portable Document Format (PDF) files. In order to do that, create a PdfExporter instance and call its Export method. If you need to set the page size and orientation, use the PageSize, and PageOrientation properties.

Miscellaneous

  • The text of links can be edited in-place.
  • The size of a DiagramNodeAdapter can be bound to the DesiredSize of the hosted UIElement by enabling the AutoUpdateSize property.
  • The ZoomToFit method zooms the view to fit the document contents in the Diagram client area.
  • To display a custom mouse cursor that does not depend on the current context, set the OverrideCursor property.
  • The MergeUndoRecords lets you merge multiple undo records into one.
  • The BringIntoView method scrolls the diagram view to make the specified item visible.
  • Keyboard navigation through the diagram implemented by the NavigateLeft, NavigateRight, NavigateUp and NavigateDown commands.

API changes

  • Now the default value of MeasureUnit is WpfPoint.
  • The DiagramItemState and DiagramItemProperties -derived classes corresponding to the built-in diagram item types have been made public. This should make it easier to implement undo for properties added to custom item types derived from the built-in ones.
  • The ItemWidth, ItemHeight, ItemLeft and ItemTop attached properties have been replaced by the DiagramNode.Bounds attached property.