I have several controls on a page. It happens to be a Silverlight page but I don't think that it matters for this question.
When a control's value changes, a change event is raised. In this event I do a calculation and change the value of one of the other controls. This in turn causes the other control to raise a changed event which in turn causes the calculation to be (redundantly) done again.
i.e. The changing of a value of any control will cause a calculation to be performed and the value of another control to change - always in this use case.
My initial attempt at solving this involved using a boolean flag and resetting it to the default value in the second event. However, this did not work and felt hokey.
How would you go about preventing the second calculation from being done?