public void UndoRedoObservableCollectionTest() { // ObservableCollection which support undo/redo. var target = new UndoRedoObservableCollection <int>(); target.CollectionChanged += ObservableCollection_CollectionChanged; target.Add(100); // You can undo/redo also. Assert.IsTrue(target.CanUndo); Assert.IsFalse(target.CanRedo); Assert.IsTrue(target.Undo()); Assert.IsTrue(target.Redo());
public void Initialize() { target = new UndoRedoObservableCollection <int>(maximumUndoTimes: 2); target.CollectionChanged += OnCollectionChanged; notifyCollectionChangedActions = new List <NotifyCollectionChangedAction>(); }