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, After loading the diagram immediately, I want to make some connections selected, but the collection of ConnectionElements is empty. I use a timer, after 1 second, there are element in ConnectionElements. Why? Thanks |
|
|
Hello jzhou The main reason for this is because the DiagramSurface uses a BackgroundWorker to help build the visuals. Although most of the work is still done in the UI thread, this approach improves the performance and makes the application a bit more responsive in some situations. Because of using a BackgroundWorker, the visuals don't instantly exist when setting the Diagram property. Another thing worth noting is that the DiagramSurface now uses virtualization. This means visual elements are only created when they are within the viewport. So getting the connection items for selection from the ConnectionElements collection could be unreliable unless they all happened to be on the screen. Because of this, I've added a new method called SelectItem to the DiagramSurface. Pass in each model item you wish to select into this method. These would be IDiagramConnection objects from the Diagram model. This method will be available in the next nightly build. Jason Fauchelle |
|
|
Hello, Thanks for the new method SelectItem, I can use it to select some connections at the first time, but later, when the user select some nodes in the diagram, I handle the selected item change event, in the event handler I use this method to select the connections of this node, it doesn't work. thanks |
|
|
Thanks for pointing this out. This will be resolved in the next nightly build. Jason Fauchelle |
|