예제 #1
0
        public void TrackCommand(ICommand command)
        {
            UndoStack.Push(command);
            RedoStack.Clear();
            var args = new UndoRedoEventArgs(UndoRedoAction.UndoPush | UndoRedoAction.RedoClear, command.DisplayText);

            UndoRedoChanged?.Invoke(this, args);
        }
예제 #2
0
        public void Redo()
        {
            if (RedoStack.Count == 0)
            {
                return;
            }
            var command = RedoStack.Pop();

            command.Execute();
            UndoStack.Push(command);
            var args = new UndoRedoEventArgs(UndoRedoAction.RedoPop | UndoRedoAction.UndoPush, command.DisplayText);

            UndoRedoChanged?.Invoke(this, args);
        }