public static void Undo()
        {
            UndoableAction cmd = Instance.removeFromUndo();

            cmd.Undo();
            Instance.addToRedo(cmd);
        }
        public static void Redo()
        {
            UndoableAction cmd = Instance.removeFromRedo();

            cmd.Execute();
            Instance.addToUndo(cmd);
        }
 private void addToRedo(UndoableAction c)
 {
     _redoCommands.Push(c);
     if (_redoCommands.Count == 1)
     {
         OnPropertyChanged("CanRedo");
     }
 }
        private UndoableAction removeFromRedo()
        {
            UndoableAction result = _redoCommands.Pop();

            if (_redoCommands.Count == 0)
            {
                OnPropertyChanged("CanRedo");
            }
            return(result);
        }
 public static void Execute(UndoableAction cmd)
 {
     cmd.Execute();
     Instance.addToUndo(cmd);
 }