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://ko.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://ko.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
Assumption to have single node as selection mode works fine for this scenario, this is helpful sample to see how toolbox can change with selection of nodes.
However do you have an existing sample where toolbox is also fully bound to different types of object in viewmodel and dragging a node from it creates an "automatic" connection with selected node - viewmodel reflects this by adding this object to parent object (previously selected node). For the sake of simplicity nodes in toolbox take geometry of square/rectangle only and system creates directional arrow from parent to child (newly dragged node).
Hello Abs,
We do not have a sample that demonstrates what you are looking for. The existing samples use the toolbox as an extension to utilize it's core functionality and how to create custom categories. I can direct you to our conconsulting services department if you require more assistance with this matter.
If you were to work with our Consulting Services team, by visiting http://ko.infragistics.com/consulting/ , Infragistics Developer Support would remain involved with your inquiry and project to insure that control issues\questions are handled by DSEs, allowing our consultants to focus on the more complex functionality of the requirement.
If you have any additional questions please feel free to ask.
So even the example you mentioned earlier: http://ko.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?
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.
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...)
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.