What is the best way to do have - (UNDO/Redo) functionality

Topics: Prism v4 - WPF 4
Apr 24, 2012 at 10:38 PM


I am wondering, if I create a WPF, PRISM, MVVM application and I want to have Undo/Redo functionality in my application.  

From PRISM prospective, what is the best (recommended/supported by PRISM team) to implement such functionality?

Or what are my options?

Thank you all in advance.




Apr 25, 2012 at 6:40 PM
Edited Apr 25, 2012 at 6:40 PM


As far as I now currently there is no official guidance in Prism regarding this kind of functionality.

However, you might find that there are several articles in the web discussing different approaches on how to implement these scenarios. In my opinion which implementation you use will depend mostly on your personal preferences and the requirements of your scenario.

For example, as mentioned in this thread, if you what are you looking is adding functionality to commit or rollback changes to an object that is used as a data source, you may benefit from the IEditableObject Interface.

Also you could find the approach mentioned in the following blog post interesting:

On the other hand, you could achieved Navigation Undo-Redo Functionality (that is, going back and forward between views in a specific region) using the Navigation Journal provided by Prism. You could find more information about the use of the Navigation Journal in Chapter 8: Navigation of the Prism documentation.

I hope you find this useful,

Agustin Adami