/// <summary> /// Undo the last edit. /// </summary> private void Undo(object sender, RoutedEventArgs e) { if (states.Count > 1) { // discard current state states.Pop(); var lastState = states.Peek(); InkCanvasWithUndo1.SetMemento(lastState); } label1.Content = states.Count; }
private void Undo() { if (_states.Count > 1) { _states.Pop(); var lastState = _states.Peek(); InkCanvasWithUndo1.SetMemento(lastState); } StatesCountLabel.Content = _states.Count; }