private void StoreState() { var memento = UndoableInkCanvasTest.CreateMemento(); _undoStates.Push(memento); MementoUndoLabel.Content = _undoStates.Count; }
private void Undo(object sender, ExecutedRoutedEventArgs executedRoutedEventArgs) { if (_undoStates.Count > 1) { _redoStates.Push(_undoStates.Pop()); var lastState = _undoStates.Peek(); UndoableInkCanvasTest.SetMemento(lastState); } MementoUndoLabel.Content = _undoStates.Count; MementoRedoLabel.Content = _redoStates.Count; }