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
430
XamDiagram: ReadOnly
posted

Hi,

please can someone tell me how to make my XamDiagram ReadOnly? In particular, I would like prevent dragging of the nodes and deletion.

Thank you,

Phil

Parents
  • 34810
    Verified Answer
    Offline posted

    Hello Phil,

    Thank you for your post.

    To only prevent dragging of nodes and deletion, but leave all other features, I would recommend handling the NodeMoving, ConnectionMoving, and ItemRemoving events of the XamDiagram. These three events are cancellable and will prevent dragging and deletion if all three are cancelled.

    Alternatively, you could write a Style for DiagramNode and DiagramConnection that sets the IsEnabled property to false, which will disable editing, selection, moving, and removing on each of the nodes and connections.

    If you would like to keep selection, but remove the ability to edit, delete, and move the nodes, consider cancelling the three events mentioned above first. Then, you can write a Style for DiagramNode and DiagramConnection to set the EditTemplate to something that is not editable, such as a TextBlock.

    I hope this helps you. Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer
    Infragistics Inc.
    www.infragistics.com/support

Reply Children
No Data