AddFromTemplateCommand is updated for better SetLocation logic.