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
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,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Thanks Andrew - this is what I was looking for.