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 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://es.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.
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).
Thank you for following up. The XamDiagram exposes a SelectionChanged event that I recommend using to achieve your requirement since there is no direct behavior built-in to create your own category and shapes to reflect the selection made by the end user. Before getting started please note that the following items will be utilized when configuring your own toolbox category:
1. The ViewModel/Model that contains properties represented from each diagram node. 2. A new DiagramToolboxCategoryCollection3. A new DiagramTooloxCategory 4. DiagramToolboxItem5. DiagramNode
Keep in mind that by default you can select more than one diagram node at a time. Depending on your requirement this may block you from achieving your requirement. Therefore you can set the XamDiagram's SelectionMode property to Single for the end users.
Inside the SelectionChanged event you will need a new DiagramToolCategoryCollection and added to the XamDiagram's CustomCategories collection. Then you will a unique DiagramToolboxCategory based on which type of diagram node was selected. Having access to your model will be useful. You can write logic around your Model's properties and depending on their value you can add the correct category to the toolbox. When creating DiagramNodes you can utilize the System.Windows.Media.PathGeometry when constructing a custom shape and add it to the diagram node's Geogmetry property. And if you were to use a context menu I recommend showing a regular window with the toolbox in the same manner.
Please review my sample attached below for an example on getting started with custom categories. Let me know if you have any quesitons.
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,
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.