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
|
Were having a few problems getting the undo manager to work as expected. The docs for the undo manager state that the Takesnapshot method should be called after a change has been made to the diagram. We have put the take snapshot in the event handlers for node changed and collection changed, on the basis that the node has been removed from the diagram at this point. Actually undoing though seems to be a bit hit and miss, the canundo method seems to only return true intermittently for no apparent reason, not allowing us to undo on many occasions. Can you provide any more guidance as to how to make use of the undo manager, and why our setup might not be working?
Cheers |
|
|
Hello Any actions that the diagramming framework provides will provide automatic support for taking a snapshot. So adding, editing, moving and deleting elements will automatically be added to the undo feature when appropriate. You should not need to call TakeSnapshot when a node has been deleted. You will only need to call TakeSnapshot for custom properties and behaviours that you provide. Let me know if the undo feature doesn't seem to be including the 'delete node' action though. I have not been able to reproduce the issue with the CanUndo behaviour. Note that to use the undo feature, you don't need to use the UndoManager class. You can undo by using the ApplicationCommands.Undo command. How would you like to invoke the undo command? Through the press of a button, or through some other logic? If things still aren't working, could you please send us a repro that demonstrates how you are using the undo feature. |
|