Project Description
This project attempts to solve the age-old programmer problem of supporting unlimited undo/redo in an application, in an easily reusable manner. The project targets the WPF framework, and is partly based around making the ICommand interface undoable. It is developed in C#.

Detailed Description
One of the most common problems faced by programmers of line of business (LOB) applications is supporting multi-level/infinite undo/redo. This problem has been solved in a (semi-)reusable manner several times. However,this project is an attempt to solve this problem yet again, in this case for WPF applications written in the Model-View-ViewModel (MVVM) pattern.

Users of the pattern will be familiar with useful interface ICommand, found in System.Windows.Input namespace, and more accurately, in PresentationCore.dll. Of course, another equally important interface is the ICommandSource interface, found in the same location, that describes an object that knows when to invoke a command. An example of an object that implements ICommandSource is ButtonBase, the immediate parent of the ubiquitous Button class. A WPF Button is capable of being used without ever touching event handlers, simply by using the Command/CommandParameter/CommandTarget properties. For a more in-depth look into the ICommand and ICommandSource interfaces:
Rather than implementing ICommand for every command in an application, a tedious and time-consuming task, MVVM programmers were quick to create classes which implemented ICommand and allowed the injection of delegates to actually expose functionality. This project attempts to further this approach and create commands that when provided with execute logic, (an optional canExecute predicate), some undo logic, and some redo logic, will automatically manage an undo and redo stack. Furthermore, using these commands should be as simple as possible, and as reusable as possible. The second requirement for this project is to support undo/redo for property changes as well.


What it Boils Down To
To understand how to use this project within your own solutions, take a look at the Documentation tab, which contains a semi-lucid tutorial for getting started. However, in my opinion, the best way to understand how this system works is to take a look at the UndoRedoFramework.Prototype project available in the source code.

Last edited Mar 8, 2010 at 8:03 PM by balasanjay, version 9