I’d like to ask some questions regarding the use of custom layers. I’ve also noticed a behaviour which I’m not sure is a bug or not.
The first question is what is the proper way to instantiate and use custom layers?
Currently I’m doing the following:
var nodeLayer = new NodeLayer();
nodeLayer.Id = Guid.NewGuid().ToString();
Is this the correct way of doing it?
Secondly, do custom layers enroll in transactions? For example, If I add a custom layer during a transaction and then rollback the transaction, is the custom layer automatically removed? Are property changes of a custom layer tracked by a transaction?
Lastly, I noticed an odd behaviour regarding custom layers.
This is the current process:
- Create custom link and node layers and add them to the diagram
- Create nodes and links
- Add nodes and links to a group
- Bind the group, nodes and links to the custom layers using the Part.LayerName dependency property
The first time I perform this process it works as expected. However, If I repeat the process a second time, the links do not plot properly. See the image below: (the group on left is when I execute the process the first time. The group on the right is when I execute the process the second time)