private void StoreState()
        {
            // Save state to memento
            var memento = InkCanvasWithUndo1.CreateMemento();

            states.Push(memento);
            label1.Content = states.Count;
        }
Beispiel #2
0
        private void StoreState()
        {
            var memento = InkCanvasWithUndo1.CreateMemento();

            _states.Push(memento);

            StatesCountLabel.Content = _states.Count;
        }
 /// <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;
 }
Beispiel #4
0
        private void Undo()
        {
            if (_states.Count > 1)
            {
                _states.Pop();

                var lastState = _states.Peek();
                InkCanvasWithUndo1.SetMemento(lastState);
            }

            StatesCountLabel.Content = _states.Count;
        }