Exemplo n.º 1
0
        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());
Exemplo n.º 2
0
 public void Initialize()
 {
     target = new UndoRedoObservableCollection <int>(maximumUndoTimes: 2);
     target.CollectionChanged      += OnCollectionChanged;
     notifyCollectionChangedActions = new List <NotifyCollectionChangedAction>();
 }