Exemple #1
0
        public void Push(UndoAction action)
        {
            stack.Push(action);

            if (stack.Count == 1)
            {
                RaiseIsEmptyChanged();
            }
        }
        public void AddAction(UndoAction action)
        {
            if (!isEnabled)
            {
                return;
            }

            if (state != UndoState.None)
            {
                return;
            }

            undoStack.Push(action);
            redoStack.Clear();
        }