Hi Walter,
- For ForceDirectedLayout you can set ForceDirectedVertex.IsFixed to true for those nodes you don’t want the layout to move.
For other layouts there isn’t any easy way to do that and have the fixed nodes affect the layout. That’s because adding a node or even changing the size of a node might affect the locations of all of the other nodes.
But for TreeLayout if you have added some children to a parent node, you could create a TreeNetwork consisting of the parent node and all of its children links and children nodes, and just perform the layout on that with TreeLayout.Arrangement=“FixedRoots”. But there could easily be some overlap of the sub-tree arrangement with other parts of the tree, if there wasn’t room.
- I’m sorry, but I don’t understand your question: A “good MVVM way to do” what? Unless you’re still talking about partial layouts, which has nothing to do with MVVM design.
You might want to search this forum for posts about MVVM.
Thanks Walter,
Yes, since the non-trivial layouts operate on separate networks of vertexes and edges, there wasn’t any easy way to use data-binding to set up those vertexes, which are usually created temporarily during the layout.
That’s particularly true for vertexes and edges that don’t have any corresponding Node or Link. That happens when one adds dummy “nodes” or dummy “links” that are only used for influencing the layout.
The only thing you can easily data-bind is go:Part.LayoutId to “None” if you don’t want that Part to participate in the layout at all.