What’s new in WPF Flow Diagrams

Since the release of our WPF Flow Diagrams product we have been getting loads of great feedback and suggestions, which we’ve been using to drive new features. Here’s a rundown of what we’ve been adding to WPF Flow Diagrams over the past few months.

Diagram Model Enhancements

In the RTM version of WPF Flow Diagrams, the set of connection points — the places where a line can connect to a node — was fixed when the node was created. We’ve now added the ability to dynamically add more connection points to a diagram node through a user action. This can be useful for various situations such as making sure that some kind of node will always have at least one available output for attaching a connection.

It is also now possible to dynamically change the positions of connection points on a diagram node. Usually, each connection point is given a relative placement on their node which is set up within the node’s constructor, but this feature enables you to override those initial placements. Check out the ConnectionPointRelocation sample, included with this product, to see how to reposition individual connection points in response to user actions.

We have added a Data property to IDiagramConnectionPoint allowing connection points to store arbitrary data if relevant for your diagrams. This can also be used to provide connection points with tool tips.

Using the new RaisesBoundsChangeRequested attached property and the BoundsChangeRequested event on DiagramNodeElement, a node can be set up to change size depending on its contents. This is useful for having a node expand when typing text into a text box or by opening up an expander situated inside a node.

New DiagramSurface features

We’ve also been adding feature to the DiagramSurface control, mostly to provide finer control over what your users can do with the diagram.

For example, if you don’t want connections to be able to latch onto other connections (for example in a loop), the new CanConnectToConnection property allows you to disable this.

We’ve also refined the “read only” behaviour. In RTM there’s a single global IsReadOnly flag, but now we’ve provided finer control via the CanAddOrRemoveNodes and CanModifyConnectivity properties to the DiagramSurface. These allow you to enable or disable node or connection creation and deletion individually.

In addition, you can now control scroll bar visibility on the DiagramSurface in the same way as you can on a ScrollViewer.

ViewModel Support

Since we released FlowDiagrams, it has been possible to use a FlowDiagramModel as a ViewModel. In order to allow the ViewModel to act solely as an observer of the business model, and thereby avoid the complications of two-way synchronisation between the ViewModel and the business model, we provided the IDiagramNodeBuilder interface so that you could translate UI “add node” actions directly into business model actions. We have since extended this with three more interfaces to allow you to translate other UI actions directly into model terms. IDiagramNodeRemover and IDiagramConnectionRemover allow you to handle the deletion of nodes and connections respectively; IDiagramConnectionRelocator allows you to handle when the user changes the connectivity of the diagram. By providing your own implementations of these interfaces, you can have these UI actions take effect on your business model and let changes flow naturally upward to the ViewModel.

All these features have been inspired by the feedback and requests from our customers. You can get them from the nightly builds builds page, and if there are any features or support that you would like with any of our products or you find a potential bug then jump into the forums and let us know. We love to hear from you and we really appreciate your feedback and suggestions!

Tagged as WPF Diagrams

Leave a Reply


Join our mailer

You should join our newsletter! Sent monthly:

Back to Top