Detecting Property Changes
My little rant generated some questions that it may be easier to clear up here than 140 characters at a time. Sometimes you want to execute some functionality when changing the value of a property. The key word there is “changing”. In order to know if the property changed you must compare the new value to the current value. It looks something like this: // some field in your class int value; void SetValue(int newValue) { if (value != newValue)…