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, We have recently updgraded our Mindscape WPF diagram version from 2.0 to 4.0. We have a code section as below:
This worked perfectly fine and vertical ScrollBar of the outer ScrollViewer was Visible and Enabled, and could scroll though about 40 to 50 diagram nodes which are vertically placed. We have a code section which doesn't allow panning in vertical direction, and that is why we have the outer ScrollViewer there. But after the upgrading to new Dlls we see that the VerticalScrollBar of the outer ScrollViewer is Visible but is Disabled(Checked via Snoop and found that the PART_VerticalScrollBar.IsEnabled is false). Due to this I am not able to scroll down on the diagram surface. What changes were made in the 4.0 version which caused this behavior? How do I make sure I get the VerticalScrollBar IsEnabled state back to True and be able to scroll down/up. Thanks. -Nishanth |
|
|
Hi, I have attached a sample project below. I deliberately didn't include the Mindscape DLLs. If you reference the sample project with Mindscape WPF Diagram 2.0 DLLs the scrollviewer works perfectly. But when you reference the project with 4.0 DLLs, scroll viewer doesn't work. Thanks. -Nishanth |
|
|
Hi Nishanth, Thanks for sending a repro. Here is the reason why this has changed: In version 2, the bounds of the diagram was calculated using a custom internal layout panel that unioned the bounds of all the node and connection visual elements. Calculating the bounds should have been the responsibility of the model, and so in version 3, new logic was written to manage the bounds of the diagram. Furthermore, with the introduction of virtualization, the old method was no longer viable. As a result, the internal layout panel become redundant and was removed. A side-effect of this was that the layout panel also affected the dimensions of the DiagramSurface when placed inside a size-to-children panel such as a StackPanel or ScrollContentPresenter. This was dismissed as the DiagramSurface was not originally intended to be used in a size-to-children manner. Fortunately this should be easy to work around in your app. If you simply set the Height property of the DiagramSurface, then you'll see the outer scroll bar will start working. If you are just displaying a vertical list of nodes, calculating the appropriate height should be easy - multiply the height of the model bounds of a single node plus a separation margin by the number of nodes. That said, if you get a chance, I'd recommend removing the outer scroll viewer if possible. The current set up can't take advantage of the performance improvements provided by virtualization. It should be possible to control the built-in scroll viewer to achieve the behaviour you want. Hope setting the Height helps. Let me know if you have further questions about any of this. -Jason Fauchelle |
|
|
Thanks Jason. Calculating height and setting the Height Property for Diagram surface seems to be working. Will update you if I run into any other issues due to this. Regards, Nishanth |
|