UndoService

I recently published a generic undo/redo service on NuGet and GitHub. It is based on the momento pattern and uses delegate methods to access state.

The main benefit of this is how simple it is to use. To use it, you pass the type that is used to store state and the methods to get and set the state (most likely in wrappers to match the delegate signature). Once that is in place, you just invoke RecordState() to get the state and store it in the Undo stack, along with Undo(), Redo() and Clear() methods as appropriate.

The data structure it uses depends on whether you set a limit on the number of states that it stores. If a limit is set, it uses a dropout stack. Without a limit, it uses a standard stack.

There is no nesting or grouping of undoable actions. It is possible that I’ll add such a feature in the future but I have no specific plans to do so.

https://github.com/peterdongan/UndoService

https://www.nuget.org/packages/UndoService/

AutoScroller for UWP ScrollViewer

I recently published a couple of open source projects on NuGet and GitHub. One is UWP.AutoScroller. It auto-scrolls a UWP ScrollViewer when an element within it is dragged against its edge. It’s ported from a similar tool I wrote for Silverlight some time ago. 

I simplified its functionality. The Silverlight version also allowed you to programmatically scroll the ScrollViewer. This is not included in the new version – you just enable or disable the basic function.

I also simplified the code. In this version, handlers are added to events of the ScrollViewer itself instead of on elements within it. This is a simpler and more efficient approach.

Further information is in the project readme and the nuget documentation.

https://github.com/peterdongan/AutoScroller

https://www.nuget.org/packages/UWP.AutoScroller/