I'm using the class diagram for visual studio professional 2013 and whenever i change something either in code or in the class diagram they update one another. This is not the behaviour I want, i want to be able to generate the code when I want to and I don't want changes in code to affect the UML.
Is there a way to stop this 'synchronization' between the diagram and the code?
No. That synchronization is the whole idea of the class diagram.