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
|
I am using version 2.0.692.20297. I have code that calls DiagramSurface.GetViewPort after the Loaded event fires. In most cases, this call works fine. However, when I open a particularly large/complex diagram, GetViewPort throws the "Cannot get viewport when scroll viewer not instantiated" exception. If I delete a few nodes from the diagram, the exception is no longer thrown. Any ideas why this is happening and how to resolve the issue? |
|
|
Hello I tried loading a diagram with 10,000 nodes but could not reproduce the problem. Are you listening to the Loaded event of the Window or the DiagramSurface? It will be best to listen to the Loaded event of the DiagramSurface. One way to solve the problem would be to use the Dispatcher with DispatcherPriority.ApplicationIdle to ensure the ScrollViewer is set by the time you call GetViewport. Alternatively, if you send us a project that reproduces the problem, I will look to see if there is a better solution. If possible, you may want to upgrade to version 3.0 which includes performance improvements for large diagrams. Jason Fauchelle |
|