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
|
Hello, There are multiple Tab views in my application, one of them has a diagram surface, when I switch between those views, the viewport is missing after the user switch back to the diagram view, that means if the user change the viewport, and then he switch to another view and then switch back, the viewport is from (0, 0), the reason for that is the view is removed and added later (this behavior is the design of our application framework which is designed by another person). So to fix this, I store the viewport in my view model, when the view is restored, I use the DiagramSurface.SetViewport to restore the viewport, but this method works not as I expected, for example, if I set the viewport to (-760, -340, 1216, 771), the result is (-40, -20, 1216, 771). Do you have any ideas for that? Thanks |
|
|
Hello Jzhou This is certainly an area of the diagramming product that needs improvement. For now, make sure that DiagramSurface.AllowInfiniteScrolling is set to true while you move the viewport. If you don't want infinite scrolling enabled, simply set it back to false after you've set the viewport. If doing this doesn't seem to fully solve the issue, try using this line of code just before calling the SetViewport method. This has worked well for me in the past:
Where ds is the DiagramSurface instance and of course you'd want to pass in the correct X,Y values here. Hope that helps! -Jason Fauchelle |
|