public void TrackCommand(ICommand command) { UndoStack.Push(command); RedoStack.Clear(); var args = new UndoRedoEventArgs(UndoRedoAction.UndoPush | UndoRedoAction.RedoClear, command.DisplayText); UndoRedoChanged?.Invoke(this, args); }
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); }