This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I have a special requirement where I need to keep certain "special" diagram nodes stationary(i.e. unresponsive to zoom and pan) on the diagram surface, but I should have panning and zooming enabled for other nodes. When I pan/zoom the diagram surface, other diagram elements must move and go in/out of the view port accordingly but those "special" nodes should not move/resize and must always be visible and should at a fixed position in my viewport. and I must still be able to create/remove connections to these "special" nodes. Is there a way to achieve what I want? Thank you Regards, Nishanth |
|
|
Hi Nishanth, Yes this is possible, someone from Intel has done this previously which you can read about here: http://www.mindscapehq.com/forums/thread/4208 In summary, You'll want to listen to the ViewPortChanged and SizeChanged events of the DiagramSurface. In the event handlers, take the desired pixel position of each stationary nodes and convert them into a logical diagram position. A simple method for doing this is in the 5th post of the above thread. Use the logical position to set the Bounds property of the stationary nodes. The 6th post in the above thread has a demo project attached which may help, though I think it's using version 2 of WPF Diagrams. Let me know if you have further questions about implementing this. -Jason Fauchelle |
|
|
Hi Jason, Thanks you! I didn't find the old thread in my searches before I posted my question. I "almost" achieved the requirement without using the above solution- by positioning those "special" nodes relative to the TOP and RIGHT of the view-port and use percentage calculations(i.e. position the node at a particluar % of height and width of the view port, no matter what the zoom is and where it is panned to), but had some minor glitches like movement of those nodes by few pixels when zoomed in/out. I'll try the solution you pointed out to and see how it goes! :) Thanks you. Regards, Nishanth |
|