UML - Responding to changes in the model by using rules and events
You can write code that is executed whenever a change occurs in a UML model in Visual Studio. It will respond equally to changes that are made directly by the user, and by other Visual Studio extensions.