public void Redo() { if (CanRedo == false) { return; } UndoList.Push(_value); _value = RedoList.Pop(); OnPropertyChanged("Value"); OnPropertyChanged("CanUndo"); OnPropertyChanged("CanRedo"); }
public bool Redo() { if (RedoSize == 0) { return(false); } var action = RedoList.Pop(); action.PerformAction(); UndoList.Push(action); return(true); }
/// <summary> /// Performs a redo action. /// </summary> /// <returns> /// Returns true if the redo action succeeds; otherwise, returns false. /// </returns> public bool Redo() { bool flag = true; if (AllowUndo && CanRedo) { ICommand command = RedoList.Peek(); try { command.Execute(Context); } catch { flag = false; } if (flag) { UndoList.Push(RedoList.Pop()); RaiseChanged(UndoRedoOperation.Redo, command.ToString()); } } return(flag); }