protected void AddCommand(UndoCommand cmd)
 {
     RedoStack.Clear();
     UndoStack.Push(cmd);
     StackStatesChanged();
 }
 protected void ExecuteCommand(UndoCommand cmd)
 {
     cmd.Do();
     AddCommand(cmd);
 }