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
|
Hey, we need to save the chages made to our diagram directly to a persistence layer (so there is no "save" button). So lets consider the relocation of a node. When we save on every property change (every x and y changing) our application gets incredibly slow. We rather ant to save on MouseUp or on an artificial event called on "ActionPerformed" or "RelocationFinished" to reduce the messages sent to the persistence layer. Our first approach was listen to the MouseUp event which we did not find. So here the questions in summary:: 1. Is there an event or behavior wich determines if relocation, connection drawing, etc. is finished? 2. If there is no such thing as described in 1.: Is there a way to "build this on our own" (eg with the MouseUp Event)? Cheers P.S.: We use WpfDiagramming Foundation v2.0.50727 |
|
|
Hello DoZu There isn't a single event to listen to all actions, but you will be able to listen to individual control and model events. The most useful event will be Thumb.DragCompletedEvent. You can listen to this event using the following code:
Where "ds" is the DiagramSurface instance. Adding a handler in this way will listen to all Thumbs within the diagram surface. If you need to know what action occured by the event, you can check what type of thumb the sender is. For example if the sender is a MoveThumb then a node has finished being relocated. Other thumbs are: SizeThumb, RotateThumb, ConnectionSegmentThumb and ConnectionRelocatorThumb. You'll also want to listen to Nodes.CollectionChanged and Connections.CollectionChanged events on the IDiagramModel. (You can safely cast the Nodes and Connections collections to an INotifyCollectionChanged to attach the events). This will let you listen to when nodes and connections are added or removed from the model. If possible, it's best to upgrade to version 3.0 which includes greatly improved performance for rendering large diagrams. Upgrading from 2.0 to 3.0 is very simple. You can get the trial from the website: http://www.mindscapehq.com/products/wpfdiagrams or you can upgrade for free if you are a customer in your account page: http://www.mindscapehq.com/store/myaccount Jason Fauchelle |
|