public void ExecuteCommand(UndoableCommand command) { command.Execute(); this.ExecuteCommandCalled = true; this.ExecuteCommandArgument = command; this.ExecuteCommandNumberOfCalls++; }
private bool Execute(UndoableCommand command) { if (!command.CanExecute(this)) { return(false); } bool success = false; try { success = command.Execute(this); } catch (Exception ex) { ShowErrorMessage(ex.Message); } if (success) { undoManager.Add(command); RaiseStateChanged(); } return(true); }