1. A non-transitory computer-readable medium storing computer-executable instructions that when executed on a processor propagate attributes in a graphical model, the medium storing instructions for: associating a mode switching event with a first element of the graphical model, the graphical model representing a system configured to operate using a first behavior, the first element containing: a second element with a selected attribute, and a third element; and generating code from the graphical model for propagating the selected attribute from the second element to the third element in response to the mode switching event.