Is it possible to use xamDiagram to allow user building a workflow (starting with root node and each node can create a node which is allowed from parent node - not all types of node can be created from all nodes) each node correspond to a view/viewmodel and by double clicking node it renders the view based on an instance of data model?
Hello,
I recommend reviewing the following example on how to bind the XamDiagram to complex objects and user interatction here:
eg.http://es.infragistics.com/samples/wpf/diagram/binding-nodes-with-objects
You can allow your end users to expand upon the diagram by adding their own conection points and nodes via the XamDiagramToolbox compoent:
eg.http://es.infragistics.com/samples/wpf/diagram/diagram-toolbox
Let me know if you have any specific quesitons regarding this matter.
I have reviewed it, this gives just a base. Interactivity is missing from your example links.
Essentially, I would like each node to create an allowed (pre-defined) node via either toolbox or context menu. just as an example look at following picture. So the toolbox should refresh when I change the selection of node or through context menu user is only able to add a node which is allowed
Hello Abs,
I am following up to provide you with a sample that demonstrates how to add a connection based on a selected DiagramNode.
The instructions are as followed:
1. Click on either the Mother or Father node2. Expand the toobox to find the third category with the unmarked DiagramConnection3. Drag the DiagramConnection to the XamDiagram and drop it anywhere.
The connection will automatically be added to the middle and selected nodes specified. This same logic can be used to add DiagramNodes. From here you can add the objects to your view model manually.
Let me know if you have any questions regarding this matter.
Thank you for following up. The XamDiagram component has an ItemsAdded and ItemsRemoved event as well as a ConnectionConnected event. The ItemsAdded event will occur immediately dropping a new DiagramNode from the toolbox. And the ConnectionConnected event will occur when a DiagramConnection is attached to a DiagramNode's DiagrramConnectionPoint.
I tried to programmatically attach a new DiagramConnection with a selected DiagramNode within the ItemsAdded event and add the objects to your DataContext from within the ConnectionConnected event.
However I ran into issues attaching the start position for the connection to a predefined DiagramConnectionPoint that is exposed on a DiagramNode.
I am currently investigating a viable approach to your solution with my team. Let me know if you have any questions regarding this matter.
Lets assume you have family tree construction scenario which has persons in toolbox (grand father, grand mother, father, mother, son, daughter, uncle, aunt and so on...)
Which link are you having issues with?
There is no way to automatically attach shapes and connectors to ones already added and bound to the XamDiagram control. How would you know which node to connect to? Can you please clarify this requirement with a demonstration?
Keep in mind that the most recent link I provided was to point to you to our Enterprise Development team since implementing this is out of scope for developer support.
Let me know if you have any quesitons regarding this matter.
So even the example you mentioned earlier: http://es.infragistics.com/samples/wpf/diagram/binding-nodes-with-objects can that not be modified so that more nodes are added from toolbox or context menu and these nodes are connected to existing node and reflected in viewmodel?
If not, what are the workarounds/suggestions?
I have clicked on the link you provided and I am lost there not sure what to do?