Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
305
Adding Container to XamDiagram control
posted

Hi, 

I would like to have container block in the XamDiagram toolbox, if dropped the items will be part of the container, think of IF and Else Block, if there IF block do x then y and then z, here x,y,z are xamdiagram items. also I would like them to collapse and expand as well

Can you provide any out of the box solution, what are my options here.

Parents
No Data
Reply
  • 34510
    Offline posted

    Hi Manoj,

    The XamDiagram allows you to provide your own DataTemplates for the DiagramNodes so you should be able to create your own node template that will act as a container and implement expanding/collapsing.

    http://help.infragistics.com/doc/WPF/2016.1/CLR4.0/?page=xamDiagram_Configuring_the_Shape_of_Diagram_Nodes_Overview.html

    The container part I'm not so sure of.  This isn't supported out of the box (I mean the idea of containing a node inside another node).  Maybe what you can do is handle the NodeMoved event in order to detect when the user has finished moving a DiagramNode, then you can detect if the new position is inside your container node.  If so, store a reference to that dragged node so you can keep some sort of hierarchy.  You might then need to handle your own implementation of the node inside the container since DiagramNodes can't be contained inside other nodes as far as the Visual Tree is concerned.  Nodes are all rendered into the same panel.

Children
No Data