Is there any recommanded way (best practice) to split data from one model into several diagrams for different subsets of those data ?
What we are trying to do is a kind of classe designer. So we have different packages that contains classes and we’d like to have one diagram for each package.
We also need to be able to repeat the same node in several diagrams.
Of course we’d like to keep the ability of saving (and retrieving) all those data in a single operation.
Thanx in advance.
Multiple Diagrams can share the same model. This is demonstrated by the UpdateDemo sample. (In an unusual way the Visual Tree sample does too.)
What you could do is customize the PartManager by overriding the FilterNodeForData method (and maybe FilterLinkForData). As node data gets added to the model’s NodesSource collection, the FilterNodeForData predicate determines if a Node should be constructed and added to the Diagram.
So you just need to a way to determine whether a node data belongs to a particular “package”. If you add a “package” property to your custom PartManager, you can use the same class for all of your Diagrams. So you can initialize each Diagram in the following manner:
<go:Diagram . . .>
<local:FilteringPartManager Package=“Case1” />
Thank you for your quick answer.
We did think about this solution but it seems it has a flaw : the location of a node will be the same in all the diagrams it appears in. We cannot see a way to avoid that, can you ?
That’s true if you only have one “Location” property in your data and if you data-bind the go:Node.Location to that data.Location property in all of your node DataTemplates.
So you can either have multiple node location properties, or you can not data-bind go:Node.Location and allow the Diagram.Layout to position all of the nodes.